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
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
#include main() { int *p, *c, i; i = 5; p = (int*) (malloc(sizeof(i))); printf(" %d",*p); *p = 10; printf(" %d %d",i,*p); c = (int*) calloc(2); printf(" %d ",*c); }
What is c system32 taskhostw exe?
What are multidimensional arrays?
Why do we use namespace feature?
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
What does double pointer mean in c?
With the help of using classes, write a program to add two numbers.
What does c value mean?
How can I sort more data than will fit in memory?
Tell us two differences between new () and malloc ()?
What does 1f stand for?
Is c easier than java?
Write a code of a general series where the next element is the sum of last k terms.
Define and explain about ! Operator?