+ 3
How convert string to number?
i want look, easy example function! string a = "123"; ..... int b = a;
4 Antworten
+ 4
use the default library/function in C++
#include <string>
Readup/Google about it, there are quite a couple of functions in that. One of it has what you want.
+ 2
#include <iostream>
#include <stdlib.h>
using namespace std;
int main() {
string a = "1234";
int b = atoi(a.c_str());
++b;
cout<<b<<endl;
return 0;
}
+ 1
in python:
b=int (a)
for C++ check function to convert
stoi () function is there
- 1
int a = int(stringInAnIntegerFormat);