Quant Exam  >  Quant Questions  >  What will be the result of the following prog... Start Learning for Free
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 :Old string
  • c)
    Run time error/Core dump
  • d)
    Syntax error during compilation
  • e)
    None of these
Correct answer is option 'B'. Can you explain this answer?
Most Upvoted Answer
What will be the result of the following program?char *gxxx(){static c...
The program is incomplete and cannot be executed as it is missing the rest of the code after "char *g=".
Explore Courses for Quant exam
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 : stringb)The string is :Old stringc)Run time error/Core dumpd)Syntax error during compilatione)None of theseCorrect answer is option 'B'. Can you explain this answer?
Question Description
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 : stringb)The string is :Old stringc)Run time error/Core dumpd)Syntax error during compilatione)None of theseCorrect answer is option 'B'. Can you explain this answer? for Quant 2025 is part of Quant preparation. The Question and answers have been prepared according to the Quant exam syllabus. Information about 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 : stringb)The string is :Old stringc)Run time error/Core dumpd)Syntax error during compilatione)None of theseCorrect answer is option 'B'. Can you explain this answer? covers all topics & solutions for Quant 2025 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for 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 : stringb)The string is :Old stringc)Run time error/Core dumpd)Syntax error during compilatione)None of theseCorrect answer is option 'B'. Can you explain this answer?.
Solutions for 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 : stringb)The string is :Old stringc)Run time error/Core dumpd)Syntax error during compilatione)None of theseCorrect answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for Quant. Download more important topics, notes, lectures and mock test series for Quant Exam by signing up for free.
Here you can find the meaning of 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 : stringb)The string is :Old stringc)Run time error/Core dumpd)Syntax error during compilatione)None of theseCorrect answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of 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 : stringb)The string is :Old stringc)Run time error/Core dumpd)Syntax error during compilatione)None of theseCorrect answer is option 'B'. Can you explain this answer?, a detailed solution for 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 : stringb)The string is :Old stringc)Run time error/Core dumpd)Syntax error during compilatione)None of theseCorrect answer is option 'B'. Can you explain this answer? has been provided alongside types of 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 : stringb)The string is :Old stringc)Run time error/Core dumpd)Syntax error during compilatione)None of theseCorrect answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice 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 : stringb)The string is :Old stringc)Run time error/Core dumpd)Syntax error during compilatione)None of theseCorrect answer is option 'B'. Can you explain this answer? tests, examples and also practice Quant tests.
Explore Courses for Quant exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev