how to create and travel in tree

Hi all,

Assume I've two type of data types,
1. Simple
2. Complex

struct Args
{
bool type;
list<Args*> argslist;
};


Create a list that holds the complete argument list,

So I created a list
list<args> m_args;


assume my input is having below format
1. Simple
2. Complex{
Simple
complex{
simple
simple
}
}
3. Complex{
complex{ simple simple}
complex{simple}
}

all the above infor i need to repesent in the m_args.

I'm able to achive this for simple by creating a struct and push_back to m_args. But for complex type I'm not able to do.

Kindly help









I'm rather confused. Can you please repost the structure in a way that we can understand, as well as make your intentions more clear?
Hint: Use the <> button
Basically I need to parse the function definition.

Assume a funtion can have simple(int, float etc..) data type and complex datatype(user defined struct).

eg :
struct A
{
int i;
int j;
}
Struct B
{
int x;
A a;
}

void get( int s1, int s2, B c1);

so i need to parse this get funtion and I need to store it in a list or array.

a[0] = s1
a[1] = s2
a[2] = c1, x, a, i, j


Hope this might be clear. order should not change.

You mean you want to store references to user defined structs in an array?
Topic archived. No new replies allowed.