About 50 results
Open links in new tab
  1. How can I convert int to string in C++? - Stack Overflow

    2875 C++11 introduces std::stoi (and variants for each numeric type) and std::to_string, the counterparts of the C atoi and itoa but expressed in term of std::string.

  2. c++ - How can I convert a std::string to int? - Stack Overflow

    Nov 20, 2014 · To convert from string representation to integer value, we can use std::stringstream. if the value converted is out of range for integer data type, it returns INT_MIN or INT_MAX.

  3. decimal - Integer to hex string in C++ - Stack Overflow

    Feb 24, 2011 · 232 How do I convert an integer to a hex string in C++? I can find some ways to do it, but they mostly seem targeted towards C. It doesn't seem there's a native way to do it in C++. It is a …

  4. c++ - How can I convert an Int to a CString? - Stack Overflow

    Jun 13, 2014 · I can convert a Double to a CString using _ecvt result_str=_ecvt(int,15,&decimal,&sign); So, is there a method like the one above that …

  5. Convert string to int in C++ - Stack Overflow

    May 9, 2014 · I have a string, xxxxxxxxxxxxxxxxxxx I am reading the string into a structure of smaller strings, and using substr to parse it. I need to convert one of those string types to integer. atoi is not w...

  6. c++ - How to convert int to QString? - Stack Overflow

    Jul 9, 2010 · Since you mention the + operator, careful around integers, since it might very well work but internally, the operator+(const QString &s, char c) implementation is called, and the string wont …

  7. How to convert integer to string, preserving leading zeroes in C++ ...

    Nov 2, 2021 · When I am trying to convert the given integer to string through to_string function, It simply omits the leading zeroes of the integer. Why ? & how to overcome this? #include<iostream> us...

  8. c++ - convert int to wstring - Stack Overflow

    Feb 18, 2013 · 14 I want to convert an integer value (int) to std::wstring. What is the best way to do this? I'm developing for windows phone so I would rather avoid using external libraries (such as …

  9. Is there a pre-defined built-in function to convert a number to its ...

    5 There is one function available itoa present in the stdlib.h by which we can convert integer to string. It is not exactly defined in C or C++ but supported by many compilers.

  10. c++ - how to convert from int to char*? - Stack Overflow

    Converting our integer value to std::string so we can know how long (how long number of digits). Then we creating char array length of string letter size +1, so we can copy our value to string then char array.