Answer Posted / guest
malloc returns a void pointer. It needs to be cast to char*
before allocating it to char* variable.
char *p = (char *)malloc(10); should do fine.
Is This Answer Correct ? | 26 Yes | 2 No |
Post New Answer View All Answers
difference between Low, Middle, High Level languages in c ?
where are auto variables stored? What are the characteristics of an auto variable?
What is boolean in c?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
Explain what are the __date__ and __time__ preprocessor commands?
What does nil mean in c?
What is the hardest programming language?
What does the error 'Null Pointer Assignment' mean and what causes this error?
What does %2f mean in c?
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?
#include
Is swift based on c?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
What is a global variable in c?
What math functions are available for integers? For floating point?