const keyword
-
Hi, I am new to this forum.I am working as a developper in C programming and working in compiler validation project. I hope I will get good response from u people as soon as possible. My question is : I want what are the possible ways of writing codes using 'const' keyword. I have written some.I need few more. Plz go thru and send me any other cases where we can use const keyword in C only not C++. const int degrees = 360; int const degrees1 = 180; const float pi = 3.14; const char quit = 'q'; int * const var1; const int * var2; int const * var3 const char * const Var4; char const * const Var5; void test1() const; const int * test2(); /* function returns a adress that could not be modified */ void test3(const int *i); const int arr1[]={1,2,3,4,5,6,7}; char const *arr="coderzone";
-
Hi, I am new to this forum.I am working as a developper in C programming and working in compiler validation project. I hope I will get good response from u people as soon as possible. My question is : I want what are the possible ways of writing codes using 'const' keyword. I have written some.I need few more. Plz go thru and send me any other cases where we can use const keyword in C only not C++. const int degrees = 360; int const degrees1 = 180; const float pi = 3.14; const char quit = 'q'; int * const var1; const int * var2; int const * var3 const char * const Var4; char const * const Var5; void test1() const; const int * test2(); /* function returns a adress that could not be modified */ void test3(const int *i); const int arr1[]={1,2,3,4,5,6,7}; char const *arr="coderzone";
This is the Managed C++ forum, C can never be managed, so your question is off topic. Try the visual c++ forum ( or google )
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Hi, I am new to this forum.I am working as a developper in C programming and working in compiler validation project. I hope I will get good response from u people as soon as possible. My question is : I want what are the possible ways of writing codes using 'const' keyword. I have written some.I need few more. Plz go thru and send me any other cases where we can use const keyword in C only not C++. const int degrees = 360; int const degrees1 = 180; const float pi = 3.14; const char quit = 'q'; int * const var1; const int * var2; int const * var3 const char * const Var4; char const * const Var5; void test1() const; const int * test2(); /* function returns a adress that could not be modified */ void test3(const int *i); const int arr1[]={1,2,3,4,5,6,7}; char const *arr="coderzone";
there is an infinite number of const constructs; try:
int const * const * const * const * const * const * const * const * const var;
:)
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }