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 will be the output of x++ + ++x?
how can i get output like this? 1 2 3 4 5 6
how can i get output the following... 5 4 3 2 1 4 3 2 1 3 2 1 2 1 1 and 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 plz plz...
What is difference between scanf and gets?
Find Index of least significant bit set in an Integer. ex. int value is say 10001000 results should be 4.
what is the structure pointer?
How do I determine whether a character is numeric, alphabetic, and so on?
What is meant by int main ()?
What is C language ?
f(x,y,z) { y = y+1; z = z+x; } main() { int a,b; a = 2 b = 2; f(a+b,a,a); print a; } what is the value of 'a' printed
What is return in c programming?