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
What are the types of c language?
How do you declare a variable that will hold string values?
What is volatile variable how do you declare it?
Write the test cases for checking a variable having value in range -10.0 to +10.0?
Explain how to reverse singly link list.
Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.
Where can I get an ansi-compatible lint?
Is main is user defined function?
What is hash table in c?
What functions are in conio h?
Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.
When should a far pointer be used?
Explain how can I open a file so that other programs can update it at the same time?
how many key words availabel in c a) 28 b) 31 c) 32
Explain how can I remove the trailing spaces from a string?