What will be the result of the following program?
char*g()
{
static char x[1024];
return x;
}
main()
{
char*g1="First String";
strcpy(g(),g1);
g1=g();
strcpy(g1,"Second String");
printf("Answer is:%s", g());
}
(A) Answer is: First String (B) Answer is: Second String
(C) Run time Error/Core Dump (D) None of these
Answer Posted / kalyan chukka
The Answer is Second String
Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
Is there a way to compare two structure variables?
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above
What does the && operator do in a program code?
Explain Function Pointer?
How main function is called in c?
Is there anything like an ifdef for typedefs?
Can 'this' pointer by used in the constructor?
Explain what header files do I need in order to define the standard library functions I use?
What is volatile variable in c?
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none
What is C language ?
any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above
How do you redirect a standard stream?
Who developed c language and when?
What is difference between structure and union with example?