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

Here,

After char *p;
since pointer p is not initialized it is pointing at some
unknown location.

In the next step, the address of the memory allocated by
malloc() is stored at some garbage location pointed by p.

Here p is never initialized or never assigned any value.

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you tell me how to check whether a linked list is circular?

1498


Write a simple code fragment that will check if a number is positive or negative.

1209


How to declare pointer variables?

1315


How can I read data from data files with particular formats?

1093


Write a program to reverse a string.

1146


what is reason of your company position's in india no. 1.

2411


Does c have an equivalent to pascals with statement?

1067


What is structure padding and packing in c?

1124


What are lookup tables in c?

1034


What is union and structure?

1195


Is a house a shell structure?

1213


What is getch c?

1344


Is that possible to add pointers to each other?

1428


Where are local variables stored in c?

1094


How can this be legal c?

1149