Skip to content

Instantly share code, notes, and snippets.

@danspndl
Last active May 8, 2016 09:02
Show Gist options
  • Save danspndl/e4ebc3d410b93615426c1d209bfc2102 to your computer and use it in GitHub Desktop.
Save danspndl/e4ebc3d410b93615426c1d209bfc2102 to your computer and use it in GitHub Desktop.
Convert string to int - C++
#include <iostream>
#include <stdlib.h> // atoi
using namespace std;
int main(){
int intVar = 0;
string stringVar = "";
stringVar = atoi(intVar.c_str());
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment