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 a volatile keyword in c?

881


Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me

1672


Explain what is the difference between a string and an array?

875


When can a far pointer be used?

749


Explain how do you determine the length of a string value that was stored in a variable?

890


write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.

15447


What would be an example of a structure analogous to structure c?

765


Explain what is the difference between a free-standing and a hosted environment?

877


Explain the priority queues?

831


Once I have used freopen, how can I get the original stdout (or stdin) back?

819


which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;

2871


Tell me can the size of an array be declared at runtime?

792


Difference between constant pointer and pointer to a constant.

813


a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode

869


all c language question

2155