Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

How to pass a dyn. multi-D array to func.

Name: Axen 2006-06-18 12:35

I'm probablly just getting the syntax wrong.  Here's what I got.

// function declaration
void process_mat (int nMat, char matName[][25]);

// multidimensional dynamic array initialization
char **matName;
matName = new char*[nMaterials];
for (int i=0; i < nMaterials; i++)
   matName[i] = new char[25];

//function call
process_mat(nMaterials, matName);

When I try to compile, the error I get is "cannot convert type 'char**' to type 'char(*)[25]'"

Name: Anonymous 2008-02-21 3:30

>>10
Quite accurate.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List