Asked By
7060 points
N/A
Posted on - 09/18/2011
Const in c++ and in ANSI C
The programming language C and ANSIC are almost same in all aspects but i want to tell you that there are some basic and little difference in these language which includes declaration of the variables that is why the const of C++ gives you error in ANSI C i will give you simple example for your understanding C++ requires ALL functions to be declared (including their parameter types) before they are called whereas ANSI C does allow the LAZY declaration int func(); which means "don't check arguments."
This should NOT be a problem because safe C programming practice mandates the use of a function prototype, with fully specified parameters and return type (even if void).
The declaration int func();