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 are the types of c language?

1080


How do you declare a variable that will hold string values?

1231


What is volatile variable how do you declare it?

1186


Write the test cases for checking a variable having value in range -10.0 to +10.0?

2370


Explain how to reverse singly link list.

1203


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

2127


Where can I get an ansi-compatible lint?

1206


Is main is user defined function?

1211


What is hash table in c?

1078


What functions are in conio h?

1265


Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.

1157


When should a far pointer be used?

1186


Explain how can I open a file so that other programs can update it at the same time?

1184


how many key words availabel in c a) 28 b) 31 c) 32

1129


Explain how can I remove the trailing spaces from a string?

1104