just do:
Qt Code:
class MyClass : pulic ParentClass { const int arraySize .... } MyClass::MyClass():ParentClass(),arraySize(3)To copy to clipboard, switch view to plain text mode
just do:
Qt Code:
class MyClass : pulic ParentClass { const int arraySize .... } MyClass::MyClass():ParentClass(),arraySize(3)To copy to clipboard, switch view to plain text mode
Won't that get messy with a const array as in my example?
K
Oh right, you have a const array too...
Hmm...
I found this on google.
Declare in your class:
static const int arr[];
and in your cpp file:
const int MyClass::arr[] = { 1, 2, 3 };
Ha!
salubrious, dude!
that'll do, nicely.
thanks
K
Bookmarks