Can std:vector take in class too?
if i have a class like this:
class apple
{
public:
BOOL eaten;
BOOL IsEaten();
};
But if i have many "apples", then normally this could work (right?):
main()
{
apple apples[10];
}
But what if i don't know how many apples will there be? can't i use this:
main()
{
vector< apple > apples;
}
The compiler is giving out error message saying it is not a type...
Any way to solve it? ( or i'm just taking nonsence?
)
Thanks for any helps
[edited by - NewbieA on April 14, 2004 1:37:53 PM]