Const in c++ and in ANSI C

Asked By 7060 points N/A Posted on -

The const was taken from C++ and incorporated in ANSI C,

Although quite differently.


Answered By 0 points N/A #80400

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();

Login/Register to Answer

Related Questions