I'm kinda new to C++ programming, but I have an assignment where I have to use three different classes (for simplicity, I'll call them Class1, Class2, and Class3) and some vectors. So far, I have a vector of type Class1 (vector%26lt;Class1%26gt; number1;) and two of type Class2 (vector%26lt;Class2%26gt; number2; vector%26lt;Class2%26gt; number3;).
The problem that I am having with these vectors is that when I try to pass number2 or number3 by reference to Class3, when they come back, they are empty. For example, when I pass number1, the size might be 28, and in Class3 i use a function to get a value from an element inside number1. I know that at the end of the function, the vector still has a size of 28, but when I try to use number1 in another function, the size appears as 0 and causes the program to crash. Can anyone tell me what I am doing? Thanks!
Vectors Question! Help Please!!!?
Please ask your professor.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment