Code problems | Sololearn: Learn to code for FREE!

+1

Code problems

#include <iostream> using namespace std; class Array{ public: Array(string* arrCop){ this->arrCol = arrCop; } friend void arrArray(Array& obj); private: string arr[4][4]{0}, arrCol[4][4]{0}; };

8/13/2018 7:58:42 AM

Oleg Storm

4 Answers

New Answer

+4

I'm not so sure what you are trying to do here, but here's a few points to note: You initialized private members <arr> and <arrCol> with {0} but that's not acceptable, can't initialize with null. Remove the {0}. Your constructor try to assign a string <arrCop> into a multidimensional string array <arrCol>, you need to choose, into which element (in the string array) do you want to insert the <arrCop>. I don't know what to suggest here because I'm not understanding your code intention. Hth, cmiiw

+2

Ipang, thanks without a doubt, it helps a lot👍☺

+1

it says: incompatible type in line this ->arrCol = arrCop; Just want to copy arrCol value to arrCop. Any suggestions?

+1

Oleg Storm You're welcome, glad to help : )