coderzone's Avatar, Join Date: Jul 2004
Team Leader
Quote:
Originally Posted by sharmila
Hi shabbir,
Thank you.I tried that one and I understood how we have to use const variables.In C are we having any compile-time constants?or this compile-time and run-time concept is only for C++.
In C Macros are compile time constants.
sharmila's Avatar, Join Date: Mar 2006
Contributor
I mean using const qualifier.i.e compile-time and run-time concept for 'const' variables.
coderzone's Avatar, Join Date: Jul 2004
Team Leader
I guess we need to be testing this on GCC compilers rather than on VC and then we can conclude anything on const in C
sharmila's Avatar, Join Date: Mar 2006
Contributor
ok.Coderzone.Thank you.I will also try for that.If I got any doubt I will get back to you.
Thank you once again.
sharmila's Avatar, Join Date: Mar 2006
Contributor
Hi,
I tested using gcc compiler.it is not giving any errors.It is executing normally.But in VC with .c extension it is giving errors.
coderzone's Avatar, Join Date: Jul 2004
Team Leader
Quote:
Originally Posted by sharmila
Hi,
I tested using gcc compiler.it is not giving any errors.It is executing normally.But in VC with .c extension it is giving errors.
So probably its the flaw of the VC in case of const in C. Both are compile time constants const / Macros.
sharmila's Avatar, Join Date: Mar 2006
Contributor
Thank you.