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's wrong with "char *p; *p = malloc(10);"?

Answer Posted / shruti

the syntax of malloc is wrong.

in your example it should be written as:

char *p;

p = (char *)malloc(sizeof(char));

Is This Answer Correct ?    21 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is ctrl c called?

1050


What is calloc()?

1074


What is the difference between exit() and _exit() function in c?

1076


What is volatile variable in c with example?

1045


Tell me the use of bit field in c language?

1071


What is the description for syntax errors?

1170


Between macros and functions,which is better to use and why?

2228


What does the message "automatic aggregate intialization is an ansi feature" mean?

1190


please explain every phase in the "SDLC" in the dotnet.

2621


Describe dynamic data structure in c programming language?

1097


Is it acceptable to declare/define a variable in a c header?

1127


What's the best way of making my program efficient?

1110


What is the advantage of an array over individual variables?

1241


Is flag a keyword in c?

1155


What is #line in c?

1019