Advertisement

c++ and multidimensional array

Started by February 10, 2002 06:01 AM
-1 comments, last by spillsome 22 years, 7 months ago
What''s wrong with that code. i am trying to pass a multidimensional array of pointers to a function and copy the pointer, but i got an error message. C:\DDD\ddd\ddd.cpp(62) : error C2440: ''='' : cannot convert from ''class Brick *[][5]'' to ''class Brick *[][5]'' Here is the code : class Brick { }; class A { public: Brick* tabA[5][5]; }; class B { public: Brick* tabB[][5]; void mafonction(Brick* tabA[][5]); }; void B::mafonction(Brick* tabA[][5]) { tabB = tabA; //on this affectation the compiler says : cannot convert from ''class Brick *[][5]'' to ''class Brick *[][5]'' } thanks in advance

This topic is closed to new replies.

Advertisement