-
What are the advantages of auto variables?
1)The same auto variable name can be used in different blocks2)There is no side effect by changing the values in the blocks3)The memory is economically used 4)Auto variables have inherent protection because of local scope
-
Diffence arrays and pointers?
Ø Pointers are used to manipulate data using the address. Pointers use * operator to access the data pointed to by themØ Arrays use subscripted variables to access and manipulate data.Array variables can be equivalently written using pointer expression.
-
-
-
-
-
printf("Address of j=%un",&j);
printf("Address of k=%un",&k);
return 0;
}
Suppose the answer is:
Address of i=2004
Address of j=2002
Address of k=2000
why is the address decreasing ?">Consider the following program:#includemain(){int i=3;int *j;int **k;j=&i;k=&j;printf("Address of i=%un",&i);printf("Address of j=%un",&j);printf("Address of k=%un",&k);return 0;}Suppose the answer is:Address of i=2004Address of j=2002Address of k=2000why is the address decreasing ?
-
-
-
-
puts (wer):
1. prints the string 8 8 8
2. prints the null string
3. prints the string m, n, b
4. none of these
">The following program fragment int m=n=b=8; char wer[80]; sprintf(wer, "%d%d%d", m, n, b,); puts (wer): 1. prints the string 8 8 8 2. prints the null string 3. prints the string m, n, b 4. none of these
-
-
-
}
">Vi) main(){ extern int i; i=20;printf("%d",i);}
Linker Error : Undefined symbol '_i'Explanation: extern storage class in the following declaration, extern int i;specifies to the compiler that the memory for i is allocated in some other program and that address will be given to the current program at the time of linking. But linker finds that no other variable of name i is available in any other program with...
-
-
-
-
-
-
If the following program (myprog) is run from the command line as myprog monday tuesday wednesday thursday What would be the output? main(int argc, char *argv[]) { while(--argc >0) printf("%s",*++argv); }
A) myprog monday tuesday wednesday thursdayB) monday tuesday wednesday thursdayC) mondaytuesdaywednesdaythursdayD) myprog tuesday thursday
C Interview Questions
Ans