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 |
Write a program to identify if a given binary tree is balanced or not.
wap in c to accept a number display the total count of digit
What do you understand by friend-functions? How are they used?
21. #define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }
what is the meaning of 'c' language
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
What is an array in c?
What is a program flowchart?
What is wrong in this statement?
What is wild pointer in c?
What are header files and what are its uses in C programming?
in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above