"#include <string> , right click on string → Open #include file → right click on string tab → Open containing folder."
"error file not found"... but can compile.. confuse
"BTW it should be something like \MinGW\lib\gcc\x86_64-w64-mingw32\4.8.0\include\c++"
my version don't have the 4.8.0 and c++ folder...
with some dificulty i found the folder, i belive:
but i'm getting errors:
" 'std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator+(_CharT, _CharT)' must take either zero or one argument"
1) For + operator to have 2 argument it must be non-member
2) You cannot overload operators for non-class types only. Isn't going to happen sadly. (Not to mention that adding anything inside standard classes or std namespace is undefined at best)
2) Add this to any hello world example and look at the error:
1 2 3 4
intoperator+(int, int)
{
return 0;
}
It pretty much describes everything. To be able to overload operator, at least one operand should not be builtin type. Because of that we have operator+(string, constchar*)operator+(constchar*, string) overloads, but not operator+(constchar*, constchar*)Seriously, do you think standard library developers woldn't add this if this was possible?
1) There are two kinds of operators: unary and binary. Unary requires onlt one oprand (like +a, -a, !a, etc.). Binary requires 2 (like a = b, a - b, a % b, etc...).
Operators can be member and non-member. For member operators current class is implicitely first argument of operators, so unary operators require no additional operands, and binary have one.