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
Answers were Sorted based on User's Feedback
Answer / abhisheksingh462
Answer is "second string" because both handle same address
| Is This Answer Correct ? | 2 Yes | 2 No |
struct tag{ auto int x; static int y; };main() { struct tag s; s.x=4; s.y=5; printf(ā%dā,s.x); }
What is the deal on sprintf_s return value?
What are the types of i/o functions?
What is cohesion and coupling in c?
Write a program to interchange two variables without using the third variable?
17 Answers Accenture, College School Exams Tests, Infotech,
Why doesn't C have nested functions?
Explain about the functions strcat() and strcmp()?
What is the difference between constant pointer and constant variable?
What is cohesion in c?
I have a varargs function which accepts a float parameter?
Is fortran still used today?
How do I access command-line arguments?