* list_of_strings add_to_list(list_of_strings *, char []);
thats the line in the C++ code i got. i dont know what it is.
* list_of_strings add_to_list(list_of_strings *, char []);
thats the line in the C++ code i got. i dont know what it is.
I'm guessing this is a function prototype, but I don't think it's correct because it doesn't have a return type, just that its a pointer. As for the arguments, the first one is a pointer to a class/structure list_of_strings, meaning it passes a variable with the address of the real list_of_strings class. The second is a character array. It could be a string constant like: "Hello!" or a char array. Show more of the code and it would be easier to figure out what that means.
I think u r right Crossbow. I think the programmer is trying to return a list_of_strings from the function and put the * in the wrong spot. However, I don't think that it is possible to return user defined types. If I am wrong, correct me because I am interested.
* list_of_strings add_to_list(list_of_strings *, char []);
is nonsense. It probably should have been
list_of_strings* add_to_list(list_of_strings *, char []);
Which is a function prototype for a function called add_to_list which takes a list_of_string-pointer and a char array and returns the pointer.
You can use user-defined types in return statements just like inbuild types.
hth
-nv
She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."
When in doubt, read the FAQ.
Then ask a smart question.