Hello all,

I am trying to create a type that is a pointer to a struct, but I cant seem to 
access the contents of the struct. I am trying to do something like this:

typedef struct {
        int one;
        int *two;
} *myT;

int main()
{       
        myT *test = new myT;
        int y = 20;
        test->two = &y;
        test->one = 9;
        return 0;
}

I get an error that says "..left of '->two' must point to 
class/struct/union/generic type". I thought by declaring the typedef as a 
struct that it would be recognized as such?? 

I am trying to figure this out, but alas, no joy. Can anyone explain where I am 
missing it??

Any help would be appreciated,

nim


Reply via email to