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 can you increase the size of a dynamically allocated array?

1133


how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....

1742


Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?

2042


What is structure data type in c?

970


i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none

1010


How can I make it pause before closing the program output window?

990


What are the back slash character constants or escape sequence charactersavailable in c?

1124


How would you obtain the current time and difference between two times?

1237


What is formal argument?

1092


What are pointers? What are different types of pointers?

1058


Why we use void main in c?

1099


Which is the best website to learn c programming?

1032


Explain main function in c?

1045


how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12

1017


What is #ifdef ? What is its application?

1054