Created
November 13, 2020 04:59
-
-
Save Adobe-Android/703489a7cbab303e77296783c47c6747 to your computer and use it in GitHub Desktop.
Example of the useful std::to_string method in C++11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using std::cout; | |
using std::string; | |
int main() { | |
auto pi = "pi is " + std::to_string(3.14); | |
cout << pi << '\n'; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment