loskutov's blog

By loskutov, 13 years ago, translation, In English
As you probably know, the C++11 aka C++0x standard was published recently. There is "GNU C++0x 4" as an available language, and I had thought it is g++ 4.6 with -std=c++0x commandline arguement. On the yesterday's contest I used a new feature (to_string function), and it didn't compile :(. When will there be support of the new standard and what is "GNU C++0x 4", while it's not described in the related topic?
  • Vote: I like it
  • +29
  • Vote: I do not like it

| Write comment?
»
11 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Hi, Softwayer. How can I use to_string in codeforces. My code works well in my own computer, but the codeforces says 'to_string' was not in the scope. I have already include and use the std namespace. I hope you can tell me how exactly to use to_string in codeforces.

Thanks, dhuang.

  • »
    »
    11 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    It looks like you need to wait until GCC on Codeforces is updated to a newer version.

  • »
    »
    11 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    At least you can use something like this.

    int a=5;
    stringstream ss;
    ss<<a;
    string t;
    ss>>t;
    cout<<t; // 5