Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22016

Why is stoi overloaded when using a string? [closed]

$
0
0

I am converting an old C program into modern C, due to the fact that certain errors occur that did not occur in previous versions of gcc. Here is an example of code that occurs quite frequently in this, causing this error to occur:

error: call of overloaded ‘stoi(std::__cxx11::string)’ is ambiguous

Here is the code:

std::string str;
std::getline(ins, str, ''); //ins is type std::istream&
num = stoi(str); //This one fails

I checked various sources and none of them describe why this occurs, so I am confused.


Viewing all articles
Browse latest Browse all 22016

Trending Articles