Thursday, February 13, 2020

CPP: Simple data type conversion

Convert string to int:
#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;
}
view raw dataconv.cpp hosted with ❤ by GitHub


To build:
$: clang++ dataconv.cpp

Run it:
$: ./a.out

No comments:

Configuring TUN/TAP virtual network interface for use with QEMU on Xubuntu 24.04

Configuring TUN/TAP virtual network interface for use with QEMU on Xubuntu 24.04 I am planning to run qemu-system-ppc to play around QEMU ...