Computer fundamentals and C programming (Internal Notes)
Computer fundamentals and C programming (Internal Notes)
(4m)
As the name suggests, Constants are the variables whose values cannot be changed
throughout the execution of the program once they are initialized at the beginning of the
program. Constants are also known as literals. A number, a character, a string of characters,
an array, a structure, a union, a pointer, and an Enum can be set as a constant.
An identifier is a type of string of alphanumeric characters that always begins with either an
alphabetic or underscore character.
There are specific rules to define the identifiers in C, and we can not use the already defined
keywords present in the C language as identifiers.
Types of Identifiers in C
There are two types of identifiers in C language.
Internal identifier
External identifier
External Linkage Process: When we write an implementation file (.c, .cpp, etc), the compiler
generates a translation unit. A translation unit is a source file that is the combination of both
implemented file and all the header files included in it.
Internal linkage refers to everything only in the scope of a translation unit. In contrast,
External linkage refers to a whole program that combines all the translation units (or object
files).
Internal identifier
Internal identifiers are the ones that are not used in any of the external link processes. Internal
identifiers, also known as internal names; include the names of local variables. The internal
identifier can be a local variable. It has at least 31 significant characters.
External identifier
External identifiers are the ones that are used in an external link process. These identifiers are
also known as external names; include function names and global variable names that are
shared between source files. The external identifier can be a name of the function or a global
variable.
It has at least 63 significant characters.
Every C program contains statements. These statements are constructed using words and
these words are constructed using characters from C character set. C language character set
contains the following set of characters...
Alphabets
Digits
Special Symbols
Alphabets
C language supports all the alphabets from the English language. Lower and upper case
letters together support 52 alphabets.
Digits
C language supports 10 digits which are used to construct numerical values in C language.
Digits - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Special Symbols
C language supports a rich set of special symbols that include symbols to perform
mathematical operations, to check conditions, white spaces, backspaces, and other special
symbols.
Special Symbols - ~ @ # $ % ^ & * ( ) _ - + = { } [ ] ; : ' " / ? . > , < \ | tab newline space
NULL bell backspace verticaltab etc.,