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 / abhisheksingh462
Answer is "second string" because both handle same address
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
application attempts to perform an operation?
Can variables be declared anywhere in c?
What is clrscr in c?
Why main is not a keyword in c?
Where are c variables stored in memory?
What are the difference between a free-standing and a hosted environment?
What are the types of c language?
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
What is the meaning of ?
How do c compilers work?
please explain every phase in the "SDLC" in the dotnet.
Define Spanning-Tree Protocol (STP)
if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0
develop algorithms to add polynomials (i) in one variable
What is an lvalue in c?