Download presentation
Presentation is loading. Please wait.
Published byClyde Rich Modified over 6 years ago
1
trigraph ??= is for # ??( is for [ ??< is for { ??! is for |
2
tokens Smallest individual unit is token Keyword e.g. float while
Identifier e.g. main,amount Constant e.g. 100 String Special symbol e.g [] {} operator
3
Keyword & identifier,variable
Keyword have Fixed meaning Rules for identifier : - first character alphabet - only letters , digit and underscore - only 31 characters - con not use keyword - no white space
4
constant
5
Character & string Character : ‘c’ - printf(“%i”,’c’); => will print printf(“%c”,’99’); => will print c String : “c” Escape sequence : \n, \t
6
Data types Primary data type: int, float
User defined : tyepdef int unit; unit salary; Derived data tyepe : array,function,structure
7
Data types
8
operators
11
Bitwise operator
12
showbits( )
13
One’s Complement Operator
14
Right Shift Operator
15
Left Shift Operator
16
Bitwise AND Operator
17
Bitwise OR Operator
20
Operator Precedence
21
C is middle level language
Programming efficiency like high level language and Machine efficiency like low level language
22
Local and global variable
Local variable : declared inside block or function and variable is accessible in block only Global variable : declared in program accessible everywhere in program Life time of variables
23
Local variables Global variables Declared inside function body
Scope local to function Not initialized value variable with same in different function is possible Advisable to use Void main() { int i=4; } Declared outside function body Start to end of program Auto initialized to 0 variable with same in different function is NOT possible Creates difficulty in debugging Int i=1; Void main() { //code }
24
Storage classes Storage class defines scope and life time of variable
Storage class decides location of variable : Memory or CPU registers variable’s storage class tells us: - Where the variable would be stored. - What will be the initial value of the variable, if initial value is not specifically assigned.(i.e. the default initial value). - What is the scope of the variable; i.e. in which functions the value of the variable would be available. - What is the life of the variable; i.e. how long would the variable exist.
25
Automatic Storage Class
26
Register Storage Class
27
Static Storage Class Storage : Memory. Default initial value : Zero.
Scope : Local to the block in which the variable is defined Life : Value of the variable persists between different function calls.
29
External Storage Class
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.