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 does emoji p mean?
How can I recover the file name given an open stream?
What are logical errors and how does it differ from syntax errors?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none
How can I do serial ("comm") port I/O?
write a program to print data of 5 five students with structures?
List the variables are used for writing doubly linked list program.
What is difference between structure and union with example?
What is queue in c?
What are the key features in c programming language?
When is a null pointer used?
Are local variables initialized to zero by default in c?
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.