class Part{
privatepublic
Part(int num);
};
class PartContainer{
private
Part parta(45);
public
};
basically, I don't know how to make the instance parta, since it wont let me give it 45 when I make it since its in a class.. if I make it in the class function, it complains "‘parta’ was not declared in this scope" when I try to use it in the class
I tried that, but when I prototype it, it says that "candidate expects 1 arguments, 0 provided" referring to the prototype of parta, since I did not pass it the integer
maybe I'm not understanding what you meant by
"PartContainer() : parta(45) {}"
, I use a little bit different syntax, so I assumed you wanted me to pass parta to the initializer, and declare it? but it seems to think that the prototyping of parta is me declaring it >.<
Line 9 tries to initialize a Part object, rather than declare one. Initialization is done inside the class constructor, not inside the class declaration part.
Hint: If you keep (forward-)declarations and actual definitions separate (like you seem to have done), you should not see any numbers in the declaration area.
I know, but when I try to initialize parta, it thinks im declaring it, and errors me that class Part expected an integer. instead of waiting for me to declare it later.
Im stuck, so if you want to see my actual code, ill give it >.<