Reserved words

A

Main Index



argc: This is an int varible that is passed in to the main function of a program. It is a count of the number of arguments that where passed in to the program.

argv: This is a char ** pointer, a pointer to an array of pointers to char arrays. It holds the arguments that where passed in to the main of the program.

asm: This is used to introduse a section of assembly code. If you don't need it you should avoid using it. It will make your code non-transportable because the assembly code must be writen for the CPU it will run on.


B




break: Used to leave a block that is a loop block or a swith block. Use brake before the end of the block to skip the rest of the code in the block.


C




case: Used with switch, case states the value to be compaired for each conditional.

catch: Used with throw, catch traps errors that are thrown by throw. I have not found it to be of any use.

char: A data type, one byte in size and signed. Value ranges from -128 to 127, used mostly for ASCII charictors like letters, numbers and symboles.

const: A type modifyer, makes a type constant and not changeable. Can improve program run speed for varibles that do not need to be modified.

continue: Used in loop blocks. Use before the end of the loop block, causes the program to ignore the rest of the code in the block and begin at the top of the loop again.


D




default: Used with switch. If no conditional in the swith is met then the default action can be taken.

do: Used at the start of a do...while loop.

double: A data type, it should be eight bytes in size but this is not true for all compilers. Called a double because it origanly was two words (4 bytes), a double word.

E




else: Used with if, states the block of code to do if the conditional is false.

enum: An enumeration of data. Crates a collection of identifres and assigns an ordered value to them.

extern: Declares the existance of a varible without creating it. This tells the compiler to know about the varible and except that it will be created in some other part of the code that will be avalible later in the compiile or linking process.

F





float: A data type. Used for floating point values. It should be four bytes in size.

for: Used at the start of a for loop.

G




goto: Used to cause the program to jump to a different point in the code at run time. This is an absolute jump and can make the code confusing so it is generaly regarded as a bad thing and should not be used.

I




if: Starts an if conditional test.

inline: I don't remember what this is for, think I have only used it once. Maybe I will fix this later.

int: A data type. A signed hole number amount.

L




long: A data type. A signed hole number amout, a larger version of int.

R




return: Used at the end of a funciton or before the end and will cause the function to be done. If given a value then the value will be returned by the function.

S




short: A type modifer or a type. By it self it is a short int and should be two bytes in size

signed: A type modifer. Makes a variable signed.

sizeof: Returns the size in bytes of a variable or a variable type. This function happens at compile time.

static: A type modifer. Forces the program to keep the variable container active until the program ends.

struct: Allows the custom constructon of a new data type by grouping other data types.

switch: Used to perform a series of conditional tests on a variable.

T




typedef: Used to tell the compiler that the new type you have made is to be known as a type from now on.

U




union: Allows the custom constructon of a new data type by grouping other data types that will share the same space in memory.

unsigned: A type modifier. Changes a data type to unsigned so it will only be positive values. Changing a char to an unsigned char expands the positive data range. Char data range is from -128 to 127, an unsigned char has a data range from 0 to 255.

V




void: Used to identifiy some thing as unknown, undefined or unused.

volatile: I don't remember if this is for C or C++, I will find out.

W




while: Used at the start of a while loop.

0 comments:

Followers

 
C - Programming -