Bool Datatype in C - Include Stdbool.h Header File
Bool Datatype in C - Include Stdbool.h Header File
Bool Datatype in C - Include Stdbool.h Header File
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.
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.