hello guys,
i got small problem with my code can any check that cout for me please.
this is skeleton of my structure
Code:
struct emp
{
string type;
int empid;
string surname;
string firstname;
};
struct manag
{
struct emp details;
struct manag *left;
int empno;
int *empid;
struct manag *right;
struct tech *tec;
struct admin *admi;
};
and this is one of the fucntion where actaully i an using this struct
Code:
void inserttree(string str)
{
char *p,*q;
p=(char *)str.c_str();
if((q=strtok(p," "))!=NULL)
{
if(strcmp(p,"manager")==0)
{
struct manag *manag;
manag->details.type += q;
cout<<manag->details.type<<endl;
cin.get();
}
}
}
does any one find anything wrong with this code. i am just getting the first work from the string and copy that string into my struct. but when i run this code it just give an runtime error. i belive that its soemhting to do with the string which i am copying. can any one check that out for me please
ssharihs2005