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
Why can arithmetic operations not be performed on void pointers?
When should I declare a function?
What are the 5 types of inheritance in c ++?
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }
How a string is stored in c?
How pointer is different from array?
What is difference between arrays and pointers?
In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.
Is c procedural or object oriented?
how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?
A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM
What does s c mean in text?
Difference between malloc() and calloc() function?
What language is c written?
What is use of bit field?