S
sandy
I am trying to upper case a string, so I have this method:
string FileSystem::toupper(string S)
{
for (int i=0; i<S.length(); ++i)
{
S=toupper(S);
}
return S;
}
I get the errors:
invalid conversion from `char' to `const char*'
`std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const
_CharT*, const _Alloc&) [with _CharT = char, _Traits =
std::char_traits<char>, _Alloc = std::allocator<char>]'
cannot convert `std::string' to `char' in assignment
I did some looking on the Net and it appears I have done nothing new,
in fact it is almost character by character a match of 3 samples I
found on the net.
But of course... it doesn't compile.
string FileSystem::toupper(string S)
{
for (int i=0; i<S.length(); ++i)
{
S=toupper(S);
}
return S;
}
I get the errors:
invalid conversion from `char' to `const char*'
`std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const
_CharT*, const _Alloc&) [with _CharT = char, _Traits =
std::char_traits<char>, _Alloc = std::allocator<char>]'
cannot convert `std::string' to `char' in assignment
I did some looking on the Net and it appears I have done nothing new,
in fact it is almost character by character a match of 3 samples I
found on the net.
But of course... it doesn't compile.