Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Bool Datatype in C - Include Stdbool.h Header File

Download as odt, pdf, or txt
Download as odt, pdf, or txt
You are on page 1of 5

Bool datatype in C include stdbool.

h header file
Storage Class
In C, static variables can only be initialized using constant literals. This is allowed in C++ though.

Static Storage
strcpy(fun(),str) will cpy geeksforgeeks in static arr
next, base addrs of static arr will be assigned to str
next, strcpy(str,geeksquiz) will cpy geeksquiz to str which contains
base adds of arr.

Post incementing operator returns 0 on successfull operation and


pre incrementing operator returns 1
Difference between ++*p, *p++ and *++p

The expression ++*p has two operators of same precedence, so compiler looks for
assoiativity. Associativity of operators is right to left. Therefore the expression is treated as
++(*p). Therefore the output of first program is arr[0] = 11, arr[1] = 20, *p = 11.

The expression *p++ is treated as *(p++) as the precedence of postfix ++ is higher than *.
Therefore the output of second program is arr[0] = 10, arr[1] = 20, *p = 20.
The expression *++p has two operators of same precedence, so compiler looks for
assoiativity. Associativity of operators is right to left. Therefore the expression is treated as
*(++p). Therefore the output of second program is arr[0] = 10, arr[1] = 20, *p = 20.

You might also like