I have:
-cygwin 1.7.25 on windows 7/32bit
-g++ --version --> g++ (GCC) 4.8.2
-libstdc++.a --> gcc-g++-4.8.2-1
Tried to make a c++ Hello Wor
stoi works correct only on mingw64 for me. If you use Codeblocks, don't forget to check if your projects compiler is set to mingw64.