what will be the result of the following program ?
char *gxxx()
{
static char xxx[1024];
return xxx;
}
main()
{
char *g="string";
strcpy(gxxx(),g);
g = gxxx();
strcpy(g,"oldstring");
printf("The string is :
%s",gxxx());
}
a) The string is : string
b) The string is :Oldstring
c) Run time error/Core dump
d) Syntax error during compilation
e) None of these
Answer Posted / abhiraj
oldstring
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is call by value in c?
What is the use of extern in c?
Compare interpreters and compilers.
A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.
What happens if header file is included twice?
program to convert a integer to string in c language'
Give the rules for variable declaration?
What is difference between %d and %i in c?
what are non standard function in c
Write a code to determine the total number of stops an elevator would take to serve N number of people.
Difference between constant pointer and pointer to a constant.
How to delete a node from linked list w/o using collectons?
What are data structures in c and how to use them?
Explain two-dimensional array.
Can a local variable be volatile in c?