The second example is illegal syntax, maybe you meant this?
pp = (int**) malloc (m*sizeof(int))
The first example is ok in C language but not in C++, which requires the return value of malloc() to be typecast to the appropriate type of variable. Other than the typecast they both are identical.
And BTW you shouldn't expect people to respond so quickly to a question.
Last edited by Ancient Dragon; Oct 26th, 2007 at 8:16 pm.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Online 21,961 posts
since Aug 2005