main()
{
extern int i;
i=20;
printf("%d",sizeof(i));
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
Linker error: undefined symbol '_i'.
Explanation:
extern declaration specifies that the variable i is defined
somewhere else. The compiler passes the external variable to
be resolved by the linker. So compiler doesn't find an
error. During linking the linker searches for the definition
of i. Since it is not found the linker flags an error.
Is This Answer Correct ? | 22 Yes | 4 No |
Link list in reverse order.
main() { printf("%d", out); } int out=100;
main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }
#define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={0,1,2,3,4}; arr2 name="name"; printf("%d %s",list[0],name); }
writte a c-programm to display smill paces
main() { char c=' ',x,convert(z); getc(c); if((c>='a') && (c<='z')) x=convert(c); printf("%c",x); } convert(z) { return z-32; }
How to count a sum, when the numbers are read from stdin and stored into a structure?
/*what is the output for*/ void main() { int r; printf("Naveen"); r=printf(); getch(); }
main() { char a[4]="HELL"; printf("%s",a); }
#define prod(a,b) a*b main() { int x=3,y=4; printf("%d",prod(x+2,y-1)); }
void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); }
{ int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }