malloc returns void*, so you will have to cast. Since you posted this is the c++ forum and not the c forum, I am curious to why you aren't using new instead?
int* data = new int[10];
malloc returns void*, so you will have to cast. Since you posted this is the c++ forum and not the c forum, I am curious to why you aren't using new instead?
int* data = new int[10];
Last edited by Darryl; 07-24-2005 at 04:57 AM.
I was just wondering really. Is malloc() considered standard C++?
Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.
- Mike McShaffry