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 result of the following program?
void myalloc(char *x, int n)
{
x= (char *)malloc(n*sizeof(char));
memset(x,\0,n*sizeof(char));
}
main()
{
char *g="String";
myalloc(g,20);
strcpy(g,"Oldstring");
printf("The string is %s",g);
}
a) The string is : String
b) Run time error/Core dump
c) The string is : Oldstring
d) Syntax error during compilation
e) None of these

Answer Posted / v.prasad

a)the string is string

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the restrictions of a modulus operator?

1125


What is quick sort in c?

1091


write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?

2869


What is the difference between ++a and a++?

1213


What is echo in c programming?

1029


Differentiate between declaring a variable and defining a variable?

1044


Explain what is the concatenation operator?

1174


What are the preprocessor categories?

1064


Explain the advantages and disadvantages of macros.

1105


What is a node in c?

975


Which is better oop or procedural?

1071


Can you explain what keyboard debouncing is, and where and why we us it? please give some examples

2199


What is the size of structure pointer in c?

1067


Can main () be called recursively?

1123


find the sum of two matrices and WAP for it.

1140