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


Please Help Members By Posting Answers For Below Questions

What is sorting in c plus plus?

566


Why do we use main function?

638


How can I get random integers in a certain range?

614


List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2304


write a program to find the given number is prime or not

3847






I have a varargs function which accepts a float parameter?

580


WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?

1860


What is #include called?

570


What language is c written?

578


Why is c called c not d or e?

615


When can you use a pointer with a function?

571


Is r written in c?

725


Write the control statements in C language

651


What is double pointer in c?

591


What is wrong with this declaration?

614