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

a program that can input number of records and can view it again the record

1864


What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.

4241


What is the general form of a C program?

978


What are the different types of constants?

1020


What is the meaning of && in c?

963


What are the application of c?

1044


Is null a keyword in c?

1139


Why is c not oop?

928


Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?

1014


Are pointers integer?

959


What are the advantages of c preprocessor?

1209


How can I call fortran?

992


What are bitwise shift operators in c programming?

1038


Write a program to print fibonacci series without using recursion?

1066


What are the loops in c?

943