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

How does #define work?

1063


What do you understand by friend-functions? How are they used?

1207


What is wild pointer in c?

1071


How can I write functions that take a variable number of arguments?

1128


Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)

2294


What are global variables?

1181


What is c basic?

1166


Write a program to print ASCII code for a given digit.

1091


Explain what are header files and explain what are its uses in c programming?

1153


Explain what is output redirection?

1191


What is a scope resolution operator in c?

1271


Which node is more powerful and can handle local information processing or graphics processing?

1317


What is the use of header files?

1105


What is the difference between far and near ?

1191


Stimulate calculator using Switch-case-default statement for two numbers

2985