C FAQ's
C Faq's
Even though it looks like a keyword, sizeof( ) is an operator which is used to know the memory size of the data types and variables. This operator returns the number of bytes allocated for the variable (or) data type. The format of the sizeof() operator is as follows. sizeof(v); where v is a variable name / data type / value.
The bitwise operator performs the operation on bits (i.e. bit by bit). Using the bitwise operators we can set / reset / check any bit in the value of the variable.
The two operators = and == are used for assignment and checking respectively. If not properly used, it causes many problems. The following program illustrates what will happen if we use = instead of = =.
The operators that act upon a single operand to produce a new value are known as unary operators.
C support unary operators are : ? minus operator - ? increment operator + + ? decrement operator ? ? size operator ? (type) operator
The break statement is used to exit from all the loop constructs (while, do while and for) and switch.case statements, whereas the continue statement is used to skip all subsequent instructions and can control back to the loop control. The continue statement can be used for any loop construct.
The storage class in C provides the complete information about the location and visibility of variables. Scope of a variable means the portion of the program within which it can be referenced and lifetime means the time of its existence in the memory.
There are four types of storage classes. ? Automatic : Variable used as a local variable. This is the default one. Initial value of variable is garbage value without initialization. ? Extern : Variable used as a local variable. Retains its value during next function call. ? Regiter : Variable used as a local variable. May be stored in register if possible. Default initial value is garbage value. ? Static : Variable used as a global variable.
There are three types of bitwise operator. ? Bitwise AND(&) ? Bitwise OR(|) ? Bitwise Exclusive OR(^)
A function is overloaded when same name is given to different function.While overloading a function, the return type of the functions need to be the same