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> | |
#include <string> | |
int main() | |
{ | |
std::string data("12345"); | |
int value = std::stoi(data); | |
std::cout << "String 12345 converted to int : " << value << std::endl; | |
return 0; | |
} |
To build:
$: clang++ dataconv.cpp
Run it:
$: ./a.out
No comments:
Post a Comment