Why 1 universal struct working from within a class, but not these others

I defined the following structs in my class header file, but before the actual class definition.

1
2
3
4
5
6
7
8
struct int3{
    int r;
    int c;
    int n;
};

struct n2 {int r; int c;};
struct lex { n2 bob[25]; dlist crowd; };


However I could not utilize my constructor for my dlist as I had intended. I had wanted to initialize the dlist as such: dlist(9,0); but I get all sorts of error messages.

So I decided I would just declare an instance of a lex within a class function where it is needed, and then resize it as such:
1
2
3
4
5
6
lex a;
a.crowd.resize(9);
for (int b = 0; b < 9; ++b)
    {
        a.crowd.removeN(b+1);
    }

But I get the following error messages:
expected unqualified-id before '.' token (in re: for a.crowd.resize(9); )
expected primary expression before '.' token (in re: a.crowd.removeN(b+1); )

However, I am able to access int3 and n2s with no problems. Why don't it work?
Thanks in advance!
P. S. Also n2 bob[25]; was supposed to have been n2 bob[SIZE]; SIZE being a public member variable, which understandably would not have worked declared universally as such, but even when I tried declaring the struct definitions inside a member function it would not compile.
Post the actual source code and error message.
Topic archived. No new replies allowed.