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 / kalyan chukka
The Answer is Second String
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What is meant by initialization and how we initialize a variable?
When should volatile modifier be used?
What is boolean in c?
Give me the code of in-order recursive and non-recursive.
Is main a keyword in c?
What is abstract data structure in c?
How can you increase the size of a dynamically allocated array?
What is the difference between #include
How can you read a directory in a C program?
Can you assign a different address to an array tag?
please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................
Explain how can I manipulate strings of multibyte characters?
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none
How can I get back to the interactive keyboard if stdin is redirected?
Can math operations be performed on a void pointer?