I have a problem with converting int
to string
in Dev-C++.
I have the proper #include
, but still I get:
[Error] 'to_string' is not a member of 'std'
const int MAX_KOSZT = 999999;
string convert(int val) {
if (val == MAX_KOSZT)
{
return "--";
}
else {
if (val < 10) {
return "0" + std::to_string(val);
}
else {
return std::to_string(val);
}
}
}
void getCout()
{
cout << convert(sciana) << "," << convert(chodnik);
}