+ 1
Why'd we can't make string as the return type's of a function in the header file?
Confused with the header
3 Answers
+ 4
You can. Its valid for both C-strings and C++ strings :
C : char* strcat(char*,const char*);
C++ : string strcat(string, const string);
+ 2
I assume you're using C++ because you say header file. it's been a long time since I did any C code but I do remember that string type is not a standard data type. you mightneed to include something, maybe string.h to use it. I'm not sure this is correct but it's my best guess.
+ 1
In C++ you can but make sure the string. H header file is included.