Linked Questions

165 votes
18 answers
357k views

I was wondering if there was an alternative to itoa() for converting an integer to a string because when I run it in visual Studio I get warnings, and when I try to build my program under Linux, I get ...
Tomek's user avatar
  • 4,849
9 votes
3 answers
28k views

Possible Duplicate: Easiest way to convert int to string in C++ How can I insert int variable while creating .vtk file? I want to create file at every k step. i.e. so there should be series of ...
Mithil Parekh's user avatar
1 vote
4 answers
773 views

Looking through related Q&A's, it seems that best C++ practice for conversion to string is ostringstream stringStream; stringStream << input_value; // let's say, input_value is a ...
Joachim W's user avatar
  • 8,447
3 votes
3 answers
18k views

In C++. What are the alternatives to Integer.parseInt() and String.valueOf() of Java in C++.
Boris's user avatar
  • 805
1 vote
3 answers
17k views

Possible Duplicate: C++ long to string Easiest way to convert int to string in C++ I am use to Java where I could just use .toString() on almost anything but I am trying a few problems in C++ I ...
Seth Hikari's user avatar
  • 2,771
5 votes
3 answers
988 views

I want to convert an integer to a string. I tried it this way but this didn't work void foo() { int y = 1; string x = static_cast<string>(y); }
DebareDaDauntless's user avatar
5 votes
4 answers
1k views

Coming from a C# background, In C# I could write this: int int1 = 0; double double1 = 0; float float1 = 0; string str = "words" + int1 + double1 + float1; ..and the casting to strings is ...
LynchDev's user avatar
  • 813
0 votes
3 answers
3k views

hi recently I was learning C++ in Visual studio when I stopped on a problem when I want to use my method to log an int i need to convert it to const char* but when I do it things just crash is my code:...
Farouk's user avatar
  • 271
2 votes
3 answers
2k views

Possible Duplicate: Easiest way to convert int to string in C++ Does anyone know how to do that conversion? I need to concatenate a intptr_t type to a string, and therefore need to convert it. ...
Alon_T's user avatar
  • 1,440
0 votes
3 answers
763 views

Possible Duplicate: Easiest way to convert int to string in C++ I have a question about Visual C++ Strings. I want to concatenate the next string. for (int i=0; i<23; i++) { imagelist....
user558126's user avatar
  • 1,271
-2 votes
3 answers
832 views

How to convert int and std::string to char* ? I'm trying to do this : int a = 1; std::string b = "str"; char* x = a + b; I don't want something like this: std::stringstream ss; std::string str2char;...
user3472134's user avatar
1 vote
3 answers
399 views

I am trying to code a Binary tree and am currently trying to get an 'inorder' function to work which takes in a binary tree containing integers and outputs the binary tree to a string in numerical ...
S Edgar's user avatar
  • 19
-2 votes
2 answers
499 views

I have a function which accept a string parameter and I have an integer variable then I should convert it to string and then pass it to that function I used this code but as ostringstream is for I/O ...
Elnaz Yousefi's user avatar
0 votes
3 answers
437 views

Suppose my code is: int x = 4; string alpha; Now i want to print x using alpha, that is using cout << alpha; For example in this case i want 4 to be printed on screen, how to do this ?
Nishu's user avatar
  • 191
-3 votes
1 answer
733 views

How can I rewrite my readDetails function without using stod() or strtod() in C++? The compiler I will be using doesn't have c++11 enabled and I get 'stod' was not declared in this scope error int ...
TMosley's user avatar

15 30 50 per page
1
2 3 4 5
7