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 sorting in c plus plus?
Why do we use main function?
How can I get random integers in a certain range?
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
write a program to find the given number is prime or not
I have a varargs function which accepts a float parameter?
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
What is #include called?
What language is c written?
Why is c called c not d or e?
When can you use a pointer with a function?
Is r written in c?
Write the control statements in C language
What is double pointer in c?
What is wrong with this declaration?