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
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
What are the advantages and disadvantages of a heap?
Why do we use c for the speed of light?
Write a program to print fibonacci series using recursion?
There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?
How do you define structure?
What are the disadvantages of a shell structure?
what value is returned to operating system after program execution?
List some basic data types in c?
What are types of structure?
Explain how can a program be made to print the line number where an error occurs?
How variables are declared in c?
Can you please explain the difference between syntax vs logical error?
Is it acceptable to declare/define a variable in a c header?
What is array of structure in c?