Re: Simple Vector Problem
tilt,
Your question is unclear. Please phrase your question in the form of a question.
Chris.
Re: Simple Vector Problem
Opps, thanks for the help though. Got it.
Re: Simple Vector Problem
Quote:
Originally Posted by tilt
Still, I don't know how to assign the square numbers to the vector:
So learn with a small test program. You should start out with a simple example of how to use a vector instead of putting a live (or developing) application through this learning process. Once you know how to use vector, then and only then should you use it in a larger application.
Code:
#include <vector>
void foo(std::vector<int>& v)
{
// what do you want to do with v?
}
int main()
{
std::vector<int> MyVect;
//...
foo( MyVect );
}
//...etc
Now, from this simple program, what exactly is it you want to do? Whatever it is, you can test it very easily, all without bringing up game boards, occupied squares, etc.
So is MyVect empty? Does it already have data?
Regards,
Paul McKenzie
Re: Simple Vector Problem
Thanks for the advice Paul, I appreciate that.