what we have here is a classic example of bbcodepointerexception
Name:
Anonymous2008-02-20 19:42
HAY GUYS HOW DO I POINTER
Name:
Anonymous2008-02-20 19:43
OH fuck i'll help him. avoid using [] in function definitions. just use *'s. C treats them the same but it saves getting confused.
Name:
Anonymous2008-02-20 20:06
There is no such thing as a multidimensional array. C++ only has arrays of arrays, i.e. arrays whose elements are other arrays. char **matName is not an array, it's a pointer to pointer to char. If you want to pass it to a function, make it take a char **. char matName[][25] (bbcode failure?) is a declaration of an array (of unknown size) of an array (of size 25) of char. Strictly speaking this should be invalid, since this is a function parameter, function arguments are passed by value, and there are no array values. However, a function parameter declared as array [N] of type T is silently adjusted to pointer to T; any size information is ignored. In other words, the compiler just pretends you've written char (*matName)[25] (that's a pointer to an array [25] of char).
This is also what the error message says: a pointer to pointer to char is not compatible with a pointer to an array [25] of char.
Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy