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
Which header file should you include if you are to develop a function which can accept variable number of arguments?
What is the purpose of sprintf?
What is a stream water?
What is sizeof return in c?
What is time null in c?
Tell me when would you use a pointer to a function?
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor
how to capitalise first letter of each word in a given string?
What are the different properties of variable number of arguments?
provide an example of the Group by clause, when would you use this clause
differentiate built-in functions and user – defined functions.
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
What are derived data types in c?
shorting algorithmS