Programming in C and C++: Dr. M. Babul Islam
Programming in C and C++: Dr. M. Babul Islam
Main
Memory
Computer Programming
Language
High-level
language Interpreter/ Executable code
Object code Linker
program Compiler (machine code)
Library
C Tokens
• In a C program the smallest individual units are known as C tokens.
C Tokens
Keywords:
• All keywords have their fixed meanings and these meanings
cannot
be changed.
• All keywords must be written in lowercase.
Identifiers:
• Identifiers refer to the names of variables, functions and arrays.
• Both uppercase and lowercase letters are permitted.
• First character must be an alphabet or underscore ( _ ).
• Must consist of only letters, digits or underscore.
• Cannot use a keyword.
• Must not contain white space.
Constants versus Variables
Constants:
• In C constants refer to fixed values that do not change during the
execution of a program.
Constants
Numeric Character
constants constants
• Documentation Section
• Link Section
• Definition Section
• Global Declaration Section
• main ( ) Function Section
{
declaration part
executable part
}
• Subprogram Section
• Declaration of Variables:
data-type variable names;