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 about the constants which help in debugging?
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
How do you print only part of a string?
How old is c programming language?
Explain how can you tell whether two strings are the same?
What header files do I need in order to define the standard library functions I use?
Why pointers are used?
Explain what is the difference between a free-standing and a hosted environment?
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.
Explain what will the preprocessor do for a program?
Write a program to generate random numbers in c?
List some of the dynamic data structures in C?
Sir i need notes for structure,functions,pointers in c language can you help me please
What is an auto variable in c?