I'm not having much luck with this one thing I'm trying to do with vectors (apvectors specifically. I've been using them since I first started). Basically, I have a pointer to a struct. One of the struct's members is a vector of pointers to another type of struct. What I want to do is access the members of the structs in the vector, but I can't figure out how, and I can't find much help on it. Here's basically what it's like:
The compiler wants me to do something like
but that doesn't seem right. I thought :: was only used for classes and the like, not vectors and their members. Plus, with
at the end, I think it would only refer to the x, not the vector. I'm probably overlooking something simple, but I don't know what, so could anyone help me out? I'd greatly apprectiate it.
Code:
struct somedata
{
int x = 5;
char y = '?';
};
typedef somedata *p_somedata;
struct example
{
apvector<p_somedata> thisVector(;
//other data members
};
typedef example *p_ex;
p_ex linkedList;
void getMembers(p_ex &linkedList;
{
int i = 0;
p_somedata c;
c = linkedList;
//now, here's where my problem is
cout << c->thisVector //now what?
}
Code:
cout << c->thisVector::x[i];
Code:
[i]