Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What will be the result of the following program?
char*g()
{
static char x[1024];
return x;
}
main()
{
char*g1="First String";
strcpy(g(),g1);
g1=g();
strcpy(g1,"Second String");
printf("Answer is:%s", g());
}
(A) Answer is: First String (B) Answer is: Second String
(C) Run time Error/Core Dump (D) None of these

Answers were Sorted based on User's Feedback



What will be the result of the following program? char*g() { static char x[1024]; return x; } ..

Answer / kalyan chukka

The Answer is Second String

Is This Answer Correct ?    4 Yes 2 No

What will be the result of the following program? char*g() { static char x[1024]; return x; } ..

Answer / abhisheksingh462

Answer is "second string" because both handle same address

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More C Interview Questions

What does void main return?

0 Answers  


How is a two dimensional array passed to function when the order of matrix is not known at complie time?

1 Answers   CSC,


in linking some of os executables are linking name some of them

0 Answers   IBM,


1.what are local and global variables? 2.what is the scope of static variables? 3.what is the difference between static and global variables? 4.what are volatile variables? 5.what is the use of 'auto' keyword? 6.how do we make a global variable accessible across files? Explain the extern keyword? 7.what is a function prototype? 8.what does keyword 'extern' mean in a function declaration?

0 Answers  


How can I get back to the interactive keyboard if stdin is redirected?

0 Answers  


there is two conditions , 1. while using for loop for printing 1 to 50 no's simulteneous 2. while using printf functios for printing 1 to 50 no's simulteneous with or without using variables who will take more time for compiling and execution? explain in details with reason?

1 Answers  


cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration

0 Answers  


int a=1,b=2,c=3; printf("%d,%d",a,b,c); What is the output?

14 Answers   Verifone,


What are terms in math?

0 Answers  


Why ordinary variable store only one value  

0 Answers  


Explain what will be the outcome of the following conditional statement if the value of variable s is 10?

0 Answers  


What is clrscr ()?

0 Answers  


Categories