Appendix E: C Keywords


Following is a list of common keywords used in C++.

bool

  

-Declare a Boolean variable (e.g., bool var1;)

break

  

-Break from a loop or Switch statement

case

  

-Select a condition in a Switch statement

char

  

-Declare a character variable (e.g., char ChrVar;)

class

  

-Declare a class (e.g., class MyClass{};)

const

  

-Declare a constant value (e.g., const Number = 5;)

continue

  

-Skip to next iteration of loop

default

  

-Default handler of a Case statement

delete

  

-Delete a variable from memory (e.g., delete MyVar;)

do

  

-Do loop keyword

double

  

-Declare a variable as a double (double-sized integer)

else

  

-Else condition for an If statement

enum

  

-Create an enumeration variable

false

  

-False value

float

  

-Declare a float variable (e.g., float MyNumber;)

for

  

-For loop structure

if

  

-Branch into code based on condition

int

  

-Declare an int variable (e.g., int MyNumber;)

long

  

-Declare a long integer variable (e.g., long MyNumber;)

new

  

-Declare a new variable dynamically; must be destroyed with delete

private, protected, public

  

-Access specifiers for a class

return

  

-Return from a function

short

  

-Declare a variable as a short integer (e.g., short MyNumber;)

sizeof

  

-Returns the size in memory of a variable

struct

  

-Defines a new data structure

switch

  

-Enter a branch statement

this

  

-A pointer to itself for a class

true

  

-True value

virtual

  

-Create a virtual function

void

  

-Declare variables or functions with no specified data type

while

  

-Declare a While loop




Introduction to Game Programming with C++
Introduction to Game Programming with C++ (Wordware Game Developers Library)
ISBN: 1598220322
EAN: 2147483647
Year: 2007
Pages: 225
Authors: Alan Thorn

Similar book on Amazon
Beginning C++ Through Game Programming
Beginning C++ Through Game Programming
Beginning Game Programming
Beginning Game Programming
The Ultimate Guide to Video Game Writing and Design
The Ultimate Guide to Video Game Writing and Design

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net