[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

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;
}

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 :: TCS Sopra Steria

Post Your Answer Here:     

No Discussion on this question yet!