I'm just a beginner but, shouldn't the other file be somehow included? Function s() is defined in other file as well. Sorry if I'm wrong, It's just my PHP heritage. :)
1st error: I can't figure this one out. Did you modify the code since your first post?
2nd error: See 4.
3rd error: ---
4th error: You removed extern string name; from add.cpp, didn't you? Now the compiler has no idea what name is supposed to be. Since it cannot assume that it's any type, it fails.
5th error: No idea why there are two of these.
extern string name; is in add.cpp, I didnt remove it.
----------------------------------------------------------------------------------
But can someone write to me code how can i do this without errors,
you know what i want from the abowe example;
in add.cpp to modify string in main.cpp.(I realy need this)
Thanks.
In above example if I instend of string put char, int... it works, but with string don't.
Problem is in string, maybe string have specifed declaration when we want it use in external file.
Sorry I thought that he needs to add header file and include it.
That will produce a linker error if the other function also takes the same parameters.
No I didn't thought for him to put definition in both files as well. I typed wrong I see that now, but I won't edit it. Mistake is a mistake. :)
Misunderstanding happened because I didn't write well. :(
I'm spamming here but, I have to say that I don't know what the hell is needed here anymore. :) I'm totally confused... xD
What he wants and who's commenting what?!?