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
Explain how can type-insensitive macros be created?
What is bash c?
What is a buffer in c?
Write a program to identify if a given binary tree is balanced or not.
Why pointers are used?
What is c variable?
Explain heap and queue.
What is the difference between if else and switchstatement
What are qualifiers?
What is the difference between variable declaration and variable definition in c?
What is the difference between Printf(..) and sprint(...) ?
What is the use of void pointer and null pointer in c language?
What is cohesion and coupling in c?
Is multithreading possible in c?
provide an example of the Group by clause, when would you use this clause