HELP ME TO KNOW SOME C LANGUAGE KEWORDS
-
help me to know about the some of the keywords in C language they r REGISTER,STATIC,UNION,SIGN AND UNSIGN pls take out some time and try to give me with examples.
-
help me to know about the some of the keywords in C language they r REGISTER,STATIC,UNION,SIGN AND UNSIGN pls take out some time and try to give me with examples.
Let’s see: 1) auto -> modifier automatic (ignore) 2) break -> break out of loop or ‘switch – case’ construct 3) case -> part of ‘switch –case’ construct 4) char -> a signed single byte (8-bits) character (normally) 5) const -> a promise that you are not going to change the value of a variable 6) continue –> goto start of loop 7) default –> default case in ‘switch – case’ construct 8) do –> start of ‘do-while loop’ construct 9) double –> double precision numeric value 10) else –> ‘if – then – else’ construct 11) enum -> a grouping of int sized named constants 12) extern -> declaration of a named item is in external file (normally ignored) 13) for -> start of for loop ( for( i=0; i goto named label (rarely used and only if absolutely required) 15) if -> test if true ( if( f != 0 ) do something ) 16) int -> whole numeric value (no decimal point) (size of machine word in theory) 17) long -> whole numeric value (size ?) 18) register -> suggestion to compiler to place variable in register (normally ignored) 19) return -> return variable to calling function 20) short -> 16-bit integer (int) variable 21) signed -> (modifier) sign matters +/- (ignored, because it is default behavior) 22) sizeof -> size of variable (in C++ size of object, which is not the same thing) 23) static -> life time (exist in permanent memory) 24) struct -> a grouping of values or a record. 25) switch -> start of ‘switch – case’ construct 26) typedef -> method for giving a user defined type a name 27) union -> method of combining types (rarely used) 28) unsigned -> (modifier) all values are positive ( unsigned int ) 29) void -> no return value, or no argument 30) volatile -> you can change value any time (stupid – ignore – default behavior) 31) while -> start of ‘while loop’, end of ‘do while loop’ Hmmm! I think that is all but I thought there where 32 keywords. Any way there are still 14 preprocessor keywords. Oh – by the way, the keywords are case sensitive.
INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
-
help me to know about the some of the keywords in C language they r REGISTER,STATIC,UNION,SIGN AND UNSIGN pls take out some time and try to give me with examples.
In addition to Mr. Shaw's list, you can read more about the keywords here: C++ Keywords[^] and C/C++ Keywords[^] and Google "C Keywords"[^]
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
-
Let’s see: 1) auto -> modifier automatic (ignore) 2) break -> break out of loop or ‘switch – case’ construct 3) case -> part of ‘switch –case’ construct 4) char -> a signed single byte (8-bits) character (normally) 5) const -> a promise that you are not going to change the value of a variable 6) continue –> goto start of loop 7) default –> default case in ‘switch – case’ construct 8) do –> start of ‘do-while loop’ construct 9) double –> double precision numeric value 10) else –> ‘if – then – else’ construct 11) enum -> a grouping of int sized named constants 12) extern -> declaration of a named item is in external file (normally ignored) 13) for -> start of for loop ( for( i=0; i goto named label (rarely used and only if absolutely required) 15) if -> test if true ( if( f != 0 ) do something ) 16) int -> whole numeric value (no decimal point) (size of machine word in theory) 17) long -> whole numeric value (size ?) 18) register -> suggestion to compiler to place variable in register (normally ignored) 19) return -> return variable to calling function 20) short -> 16-bit integer (int) variable 21) signed -> (modifier) sign matters +/- (ignored, because it is default behavior) 22) sizeof -> size of variable (in C++ size of object, which is not the same thing) 23) static -> life time (exist in permanent memory) 24) struct -> a grouping of values or a record. 25) switch -> start of ‘switch – case’ construct 26) typedef -> method for giving a user defined type a name 27) union -> method of combining types (rarely used) 28) unsigned -> (modifier) all values are positive ( unsigned int ) 29) void -> no return value, or no argument 30) volatile -> you can change value any time (stupid – ignore – default behavior) 31) while -> start of ‘while loop’, end of ‘do while loop’ Hmmm! I think that is all but I thought there where 32 keywords. Any way there are still 14 preprocessor keywords. Oh – by the way, the keywords are case sensitive.
INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
thanks a lot for responding for my queries. regards rani
-
thanks a lot for responding for my queries. regards rani
Remember to keep in mind that some keywords act differently in C++.
char temp[10]; /* array of 10 characters */ sizeof(temp) -> is size of pointer in C – currently that is 4 bytes sizeof(temp) -> is size of object in C++ - which is 10 characters
INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
-
help me to know about the some of the keywords in C language they r REGISTER,STATIC,UNION,SIGN AND UNSIGN pls take out some time and try to give me with examples.
I'm glad you got your answer, but please don't post C questions in the C++/CLI forum in future.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "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 )