Professional Documents
Culture Documents
Example 1
const float pi = 3.14159;
const int size = 100;
char marks[size];
the declaration const size = 100;
means constant in size = 100;
*Global values can be assigned as extern const sum = 100;
Example 2
enum{a,b,c};
default values of a, b and c are 0,1 and 2,which is equal to:
const a=0;
const b=1;
const c=2;
Another method would be by declaring values explicitly as shown
enum(a=2, b=-10, c=100);
1
1/22/2011
Lines beginning with a hash sign (#) are directives for the preprocessor.
Directive #include<iostream.h> tells the preprocessor to include the
iostream standard file. This specific file (iostream) includes the
declarations of the basic standard input-output library in C++,
2
1/22/2011
For example:
3
1/22/2011