Before using a function, a prototype declaration is necessary. At this time, the types of the parameters should also be declared.
extern void func1(); void g() { func1(1); // Error } |
extern void func1(int); void g() { func1(1); // OK } |
Whereas in C programs const type objects are linked externally, in C++ programs they are linked internally. In addition, const type objects require initial values.
const cvalue1; // Error const cvalue2 = 1; // Links internally |
const cvalue1 = 0; // Gives initial value extern const cvalue2 = 1; // Links externally as a C program |
In C++ programs, if explicit casting is not used, assignment of pointers to other objects (excluding pointers to functions and to members) is not possible.