Quick Google Search

IMPORTANT NOTES OF C:

NOTES :-

1.       C was invented and first implemented by Dennis Ritchie on a DEC PDP-11 that used the Unix operating system.
2.       main( ) is not a keyword.

3.      When you call a library function, the C compiler ''remembers" its name. Later, the linker combines the code you wrote with the object code already found in the standard library. This process is called linking. Some compilers have their own linker, while others use the standard linker supplied by your operating system.

4.       In C89, at least the first 6 characters of an external identifier and at least the first 31 characters of an internal identifier will be significant. C99 has increased these values. In C99, an external identifier has at least 31 significant characters, and an internal identifier has at least 63 significant characters. As a point of interest, in C++, at least the first 1,024 characters of an identifier are significant. These differences may be important if you are converting a program from C89 to C99, or from C to C++.

5.      All nonglobal variables are, by default, assumed to be auto,

6.      When a variable declared within an inner block has the same name as a variable declared by an enclosing block, the variable in the inner block hides the variable in the outer block.

7.      Local variables are stored on the stack. The fact that the stack is a dynamic and changing region of memory explains why local variables cannot, in general, hold their values between function calls.

8.       If a global variable and a local variable have the same name, all references to that variable name inside the code block in which the local variable is declared will refer to that local variable and have no effect on the global variable.

9.      The same object may have many declarations, but there can be only one definition.

10.   The names of local static variables are known only to the block of code in which they are declared; the names of global static variables are known only to the file in which they reside.

11.   Uninitialized global and static local variables are automatically set to zero.

12.   You can only apply the register specifier to local variables and to the formal parameters in a function. Global register variables are not allowed.

13.  In C, you cannot obtain the address of a register variable by using the & operator. This makes sense because a register variable may be stored in a register of the CPU, which is not usually addressable.

14.  Here is the precedence of the arithmetic operators:
                                             Highest              ++         – –
                                                           –        (unary minus)
                                                           *           /              %
                               Lowest                +           –

      
15.  Both the relational and logical operators are lower in precedence than the arithmetic operators.


16.  The following table shows the relative precedence of the relational and logical operators:
                           Highest                 !
                                                         > >= < <=
                                                           = = !=
                                                          &&
              Lowest                     |
17.     Highest ( ) [ ] –>.
! ~ ++ – – – (type) * & sizeof
* / %
+ –
<< >>
< <= > >=
== !=
&
^
|
&&
| |
?:
= += –= *= /= etc.
             Lowest                      ,

                                    

No comments:

Popular Posts