I am facing issues while using toupper() function :
Code :
#include <iostream>
#include <string>
using namespace std;
int main (){
string input {"ab"};
string output {""};
cout << output + toupper(input[0]);
return 0;
}
the error is :
no operator "+" matches these operands -- operand types are: std::_cx11::string + int .
but if i write :
#include <iostream>
#include <string>
using namespace std;
int main (){
string input {"ab"};
string output {""};
char temp = toupper(input[0]);
cout << output + temp;
return 0;
}
it works fine. can anyone tell why ?