C Programming - Pointers - Discussion
Discussion Forum : Pointers - General Questions (Q.No. 2)
2.
Can you combine the following two statements into one?
char *p;
p = (char*) malloc(100);
Discussion:
82 comments Page 9 of 9.
Mahesh said:
2 decades ago
Here we have to allocate space for characters.so first we have to do typecasting i.e (char *).
If we give (char) it gives error because we are using pointer, then we allocate memory space by malloc().
If we give (char) it gives error because we are using pointer, then we allocate memory space by malloc().
Lingarajathi said:
2 decades ago
Hello Mr/Ms
I need clear details about pointers and pointers memory allocation, can you send me this me the details.
I need clear details about pointers and pointers memory allocation, can you send me this me the details.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers