example of the function to_string
This commit is contained in:
parent
6bf6b6a95a
commit
d8523a7e7b
|
@ -0,0 +1,14 @@
|
|||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int main(){
|
||||
// Here's an example of a progrm that takes two numbers
|
||||
// converts them to strings
|
||||
// then glues them together with string concatenation
|
||||
|
||||
int num1 = 30;
|
||||
double num2 = 2355.34;
|
||||
|
||||
cout << "Here's your output: " << to_string(num1) + to_string(num2) << endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue