I am having trouble creating a class and initializing the array class variables.
I am still new to C++ (learned programming in Java) and is still grasping the concept of arrays and pointers. Could someone show me how passing an array through a constructor to initialize an object should look like?Code:class Foo { public: int arrayOfNum[]; Foo(); Foo(int arrayIN[]); ~Foo(); }; Foo::Foo(int arrayIN[]) { arrayOfNum = arrayIN; //This is where I'm having problems at. }
Thanks in advance.



LinkBack URL
About LinkBacks



The sooner you do that, the better.