Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   I need answers (http://www.go4expert.com/forums/i-need-answers-t21552/)

krazytechno 28Mar2010 05:47

I need answers
 
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

en_7123 28Mar2010 09:53

Re: I need answers
 
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


All times are GMT +5.5. The time now is 09:42.