Y
Yvad
Hi all,
I am reading this link http://www.c-faq.com/aryptr/dynmuldimary.html.
And copy the first example to VC2003, but the compiler said "Point must
be cast explictly".
So I change the code to
//---
int **array1;
// the footnote said malloc function should be self-contained, so I
use sizeof(* array), is it right to use sizeof??
array1 = (int **) malloc(nrows * sizeof(* array1));
for(i = 0; i < nrows; i++)
array1 = (int *) malloc(ncolumns * sizeof(int));
//---
Is it right?
Best regards,
Davy
I am reading this link http://www.c-faq.com/aryptr/dynmuldimary.html.
And copy the first example to VC2003, but the compiler said "Point must
be cast explictly".
So I change the code to
//---
int **array1;
// the footnote said malloc function should be self-contained, so I
use sizeof(* array), is it right to use sizeof??
array1 = (int **) malloc(nrows * sizeof(* array1));
for(i = 0; i < nrows; i++)
array1 = (int *) malloc(ncolumns * sizeof(int));
//---
Is it right?
Best regards,
Davy