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 / parasher

char *p;

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

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by inheritance?

1057


1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. The Logic should be written in Data Structures?

2409


write a c program to calculate sum of digits till it reduces to a single digit using recursion

3259


What are the disadvantages of a shell structure?

1285


Can you assign a different address to an array tag?

1124


When is a “switch” statement preferable over an “if” statement?

1081


What is the meaning of c in c language?

1092


What is a example of a variable?

960


differentiate built-in functions and user – defined functions.

1048


What are predefined functions in c?

1044


FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above

1072


Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].

1060


What is pointer to pointer in c?

1071


How can I trap or ignore keyboard interrupts like control-c?

1028


Which is better malloc or calloc?

1066