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
Explain what is output redirection?
What is the c value paradox and how is it explained?
How can you read a directory in a C program?
Explain do array subscripts always start with zero?
What are the Advantages of using macro
How can you increase the allowable number of simultaneously open files?
How can you invoke another program from within a C program?
What are the disadvantages of c language?
What is difference between class and structure?
Is c compiled or interpreted?
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
What are the different types of data structures in c?
Which is better between malloc and calloc?
What do you mean by invalid pointer arithmetic?
What are all different types of pointers in c?