I need answers

krazytechno's Avatar, Join Date: Mar 2010
Go4Expert Member
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's Avatar, Join Date: Feb 2010
Ambitious contributor
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 by en_7123; 28Mar2010 at 09:56..