C Programming :: String - Discussion
Home > C Programming > String > MCQs Questions Discussion
21 / 26
What will be the result of the following program?
#include<stdio.h>
#include<string.h>
char *gxxx(){
static char xxx[1024];
return xxx;
}
int main(){
char *g="string";
strcpy(gxxx(),g);
g = gxxx();
strcpy(g,"oldstring");
printf("The string is : %s",gxxx());
return 0;
}
#include<stdio.h>
#include<string.h>
char *gxxx(){
static char xxx[1024];
return xxx;
}
int main(){
char *g="string";
strcpy(gxxx(),g);
g = gxxx();
strcpy(g,"oldstring");
printf("The string is : %s",gxxx());
return 0;
}
AThe string is: string
BThe string is: Oldstring
CRun time error/Core dump
DSyntax error during compilation
ENone of these
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
No Discussion on this question yet!