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
How do we open a binary file in Read/Write mode in C?
Can I initialize unions?
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }
What does %c do in c?
Explain how do you determine a file’s attributes?
What is build process in c?
How can I copy just a portion of a string?
Are enumerations really portable?
How can I send mail from within a c program?
Is it possible to have a function as a parameter in another function?
What is derived datatype in c?
What is the collection of communication lines and routers called?
Did c have any year 2000 problems?
What is define directive?
What is static function in c?