Problem with char array or string

Im having a problem. I want to store some text (names) in an array. However, I cant get it to work. The code for the small function can be seen below. Note
line 6 where I try to store a text in the string array. The function x.get_color returns a string. I dont nevessary have to use string if it does not work but I dont now how to use char type either. Please help!



1
2
3
4
5
6
7
8
9
void linklist::mother_colors(std::string F_colors[]){
  node *q;
  int i;
  for( q=p, i = 0; q!= NULL; q=q->next, i++){
    if(q->x.get_age >= 2 && q->x.get_sex == 'F'){
      F_colors[i] = q->x.get_color();
    }
  }
}
Is F_colors an array of std::string?
Yes it is. I finally realised the problems after a 1 day of consideration. I was looking at the wrong place!!!

I forgot to put () at the function calls, i.e. q->x.get_sex()

Thanks for your time anyway!
Topic archived. No new replies allowed.