example of the function to_string

This commit is contained in:
left_adjoint 2024-02-05 12:53:14 -08:00
parent 6bf6b6a95a
commit d8523a7e7b
1 changed files with 14 additions and 0 deletions

14
toString1.cpp Normal file
View File

@ -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;
}