Skip to content

Instantly share code, notes, and snippets.

@Silva97
Created July 19, 2019 23:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Silva97/3c992c3af8fbc738f33f066e375bd7e2 to your computer and use it in GitHub Desktop.
Save Silva97/3c992c3af8fbc738f33f066e375bd7e2 to your computer and use it in GitHub Desktop.
#include <iostream>
int operator +(int x, std::string str){
return x + std::stoi(str, nullptr, 10);
}
int main(void)
{
int x = 5;
std::string str = "13";
std::cout << (x + str) << '\n';
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment