What's wrong with "char *p = malloc(10);" ?

Answer Posted / splurgeop

malloc return an adress to the free memory..so we shud
store the adress i.e.
the above should be

char p=malloc(10);

Is This Answer Correct ?    1 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I insert or delete a line (or record) in the middle of a file?

570


Why is c faster?

588


which type of aspect you want from the student.

1698


What is the difference between NULL and NUL?

722


What is static and auto variables in c?

561






a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none

713


How many bytes are occupied by near, far and huge pointers (dos)?

664


Why can arithmetic operations not be performed on void pointers?

583


Who is the main contributor in designing the c language after dennis ritchie?

543


Do you have any idea how to compare array with pointer in c?

598


Why do we use main function?

630


How does struct work in c?

604


Define Array of pointers.

631


Do array subscripts always start with zero?

776


What is main () in c language?

590