0

I need to perform Circular Right Shift in my program and I am doing it the following way :-

int a = 425;

int q = a / 10;
int r = a % 10;

string t = to_string(q);
string s = to_string(r);

int newnum = stoi(s+t);

cout<<newnum<<endl;

It is working on my terminal after I include -std=c++11 flag but when i tried it in Code::Blocks it wasn't working so i checked this Settings -> Compiler ->"Have g++ follow the C++11 ISO C++ language standard [-std=c++11]" but it is still giving me the error "to_string was not declared in this scope".

Manav Saxena
  • 453
  • 2
  • 8
  • 21
  • 1
    Have you included `#include` and added proper `namespace std`? – Mohit Jain Mar 27 '16 at 07:19
  • which version of codeblocks, and are you using the default compiler it came with – M.M Mar 27 '16 at 07:24
  • 2
    probably duplicate of [to_string is not a member of std, says so g++](http://stackoverflow.com/questions/12975341/to-string-is-not-a-member-of-std-says-so-g) – M.M Mar 27 '16 at 07:25
  • @M.M i am using Code::Blocks 13.12 and the default compiler is GNU-GCC – Manav Saxena Mar 27 '16 at 07:27
  • 1
    ok, follow the link I just posted. I would recommed using the most recent version of C::B, and also replacing the compiler with [mingw-w64](http://www.mingw-w64.org) which is much more up to date than the packaged compiler – M.M Mar 27 '16 at 07:30

0 Answers0