2
I tried using itoa, but it seems that the Uri platform does not accept, someone could give me another way to convert from string to int
Here’s the code I tried
itoa(n1, p1, 10);
2
I tried using itoa, but it seems that the Uri platform does not accept, someone could give me another way to convert from string to int
Here’s the code I tried
itoa(n1, p1, 10);
6
If your idea is to convert string to int, you should use atoi:
char num[10] = "100";
int valor = atoi(num);
detail: in C there are specific functions according to the type of input and output:
For C++11 there is the function std::stoi
. See this discussion (in English) about the advantages of the latter: https://stackoverflow.com/questions/20583945/what-is-the-difference-between-stdatoi-and-stdstoi
Browser other questions tagged c
You are not signed in. Login or sign up in order to post.
Tried to use atoi?
– Anderson Henrique
I didn’t know I had this, function I need to study a little more
– rafael marques