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 6 of 9.
Parsam sai bharath said:
1 decade ago
Actually return type of malloc() or calloc() void pointer. So should typecast it.
Mohan said:
1 decade ago
Actually we use pointer for p, then why we need another pointer for the location.
Minu kutty said:
1 decade ago
I need complete details about pointers and c++ is better than c or not.
Priyanka Bedre said:
1 decade ago
Can we write this program like.
char p;
p= (char *) malloc (1000) ;
char p;
p= (char *) malloc (1000) ;
Shailesh said:
1 decade ago
Please explain why we use a pointer.
With real time example.
Plz?
With real time example.
Plz?
Sanjay Tiwari said:
1 decade ago
Since we know that decleration+initialization=can we write.
Mahes said:
1 decade ago
I want clear details in pointer?why we use this concept?
Rishikesh said:
5 years ago
Prototype of malloc = ptr = (data type *)malloc(size);
(8)
Umashankar Singh said:
1 decade ago
Please can an one explain malloc and calloc function ?
Rajesh said:
1 decade ago
Thanks kavyashri and mahesh for good explanation.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers