Compiler behaving strange with stoi() function

Hi
I am writing a program to display numbers entered by keyboard on LCD display.
Compiler is behaving strange , In one program it shows no error with Stoi() functions but in other program it shows error all the code ,header file and library are same .
It works with this program


In this it does not work

Please help me resolve this issue.
Thanks in Advance
Akanksha

Hi,

I think you need to add std:: namespace for the stoi function.
https://en.cppreference.com/w/cpp/string/basic_string/stol

Thanks,
Toyo

Hello,
This also doesn’t work. The compiler is behaving really strange, at some instance it compiles and at other, it comes up with errors.

Regards
Akanksha

Did you include <string> header file?

Yes , it was included right from the first attempt.

I think it is because the mbed2 build does not support c++11 feature.

It is compiling the same code in other file .