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
What type of function is main ()?
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above
What is an lvalue in c?
Dont ansi function prototypes render lint obsolete?
What does a function declared as pascal do differently?
Explain how can you check to see whether a symbol is defined?
What does malloc () calloc () realloc () free () do?
What is a protocol in c?
What is malloc() function?
Which node is more powerful and can handle local information processing or graphics processing?
what do u mean by Direct access files? then can u explain about Direct Access Files?
What is "Hungarian Notation"?
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
What is self-referential structure in c programming?
How can I find out if there are characters available for reading?