I need answers

Discussion in 'C' started by krazytechno, Mar 28, 2010.

  1. krazytechno

    krazytechno New Member

    Joined:
    Mar 7, 2010
    Messages:
    38
    Likes Received:
    1
    Trophy Points:
    0
    Occupation:
    knowing the computer world as deep as possible
    Location:
    kolkata,west bengal
    1 .Why n++ executes faster than n+1.
    2. what is equivalent expression for x%8
    3. what is internal static variable external static variable.
    4. When does the compiler not implicitly generate the address of the first element of an array
     
  2. en_7123

    en_7123 New Member

    Joined:
    Feb 11, 2010
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    0
    1 . n++ and n+1 are not the same.In n++ the value of n is modified where as n+1 does not modify n.Here
    n++
    n=n+1
    Now in this n++ would run faster simply coz in n=n+1 the CPU has to allocate an intermediate register while computing.

    3 . An internal static variable is declared inside a block.It only has a block scope where as an external static var is declared outside all blocks.It has permanent storage and file scope.

    4.These are the following cases in which the not implicitly generate the address of the first element of an array
    array as an operand of the sizeof operator
    array as an operand of & operator
    array as a string literal initializer for a character array
     
    Last edited: Mar 28, 2010

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice