Can i allocate memory to an array of it or char using malloc ? if yes, then why is it so ? And if no then also why ? I am confused a little bit. thanks in advance to james sir ;)
I_m_rude
Recommended Answers
Jump to PostYes, you can use malloc() to allocate a simulated array of int or char. What were you trying to do that prompted this question?
Jump to Postis it valid to do so ?
No, it's not valid. Arrays are not pointers, they're arrays. You can use malloc() and a pointer to fake an array, but it's not natively an array. Likewise, in many cases an array will be converted into a pointer, but it's …
Jump to Postbut in initial post, u said u can so ? why ?
Obviously I didn't understand your question.
All 10 Replies
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
I_m_rude
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
I_m_rude
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
I_m_rude
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
I_m_rude
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
I_m_rude
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.