
Strings are always enclosed in double-quotes. This null character indicates the end of the string.
String constants -Example: “GeeksforGeeks”Ĥ.Strings: Strings are nothing but an array of characters ended with a null character (‘\0’). Character constants -Example: ‘a’, ‘A’, ‘z’. They are also called literals.Ĭonstants may belong to any of the data typeĬonst data_type variable_name (or) const data_type *variable_name But, the only difference is, their values can not be modified by the program once they are defined. It should be up to 31 characters long as only the first 31 characters are significant.ģ.Constants: Constants are also like normal variables. They must consist of only letters, digits, or underscore. They must begin with a letter or underscore(_). There are certain rules that should be followed while naming c identifiers: A special kind of identifier, called a statement label, can be used in goto statements. Once declared, you can use the identifier in later program statements to refer to the associated value. You cannot use keywords as identifiers they are reserved for special use. Identifier names must differ in spelling and case from any keywords. These are user-defined names consisting of an arbitrarily long sequence of letters and digits with either a letter or the underscore(_) as a first character. While in C++ there are 31 additional keywords other than C Keywords they are: asm bool catch class const_cast delete dynamic_cast explicit export false friend inline mutable namespace new operator private protected public reinterpret_cast static_cast template this throw true try typeid typename using virtual wchar_tĢ.Identifiers: Identifiers are used as the general terminology for the naming of variables, functions and arrays. C language supports 32 keywords which are given below: auto double int struct break else long switch case enum register typedef char extern return union const float short unsigned continue for signed void default goto sizeof volatile do if static while However, you can specify the text to be substituted for keywords before compilation by using C/C++ preprocessor directives. Since keywords are referred names for a compiler, they can’t be used as variable names because by doing so, we are trying to assign a new meaning to the keyword which is not allowed. Each keyword is meant to perform a specific function in a program. Tokens can be classified as follows:ġ.Keywords : Keywords are pre-defined or reserved words in a programming language. Left Shift and Right Shift Operators in C/C++Ī token is the smallest element of a program that is meaningful to the compiler. Core Dump (Segmentation fault) in C/C++. Dynamic Memory Allocation in C using malloc(), calloc(), free() and realloc(). Different ways to declare variable as constant in C and C++.
Internal Linkage and External Linkage in C.How Linkers Resolve Global Symbols Defined at Multiple Places?.How are variables scoped in C – Static or Dynamic?.
Compiling a C program:- Behind the Scenes.Interesting Facts about Macros and Preprocessors in C.Difference between #define and const in C?.ISRO CS Syllabus for Scientist/Engineer Exam.ISRO CS Original Papers and Official Keys.GATE CS Original Papers and Official Keys.