Quote:
5. How to convert a string to a number?
- Use the atoi function to convert a string to an integer.
Example:
---------------------------------------------------------------------------------------------------------------------------
#include <iostream> //preprocessor statement
#include <stdlib.h> //contains itoa & atoi
using namespace std; //choosing the namespace that we are going to use
int main() //this is where the program starts executing
{
char buffer[20];
int i = 3445;
_itoa( i, buffer, 10 );
cout<<buffer<<endl;
return 0;
}
Is that the way its the same as he has for the Int to String. I found this in the main tutorial link
VB Code:
char buffer[20];
char buffer2[20];
::GetWindowText (edit,buffer,255);
::GetWindowText (edit,buffer2,255);
int i = buffer;
int i2 = buffer2;
int i3 = i + i2;
_itoa( i, buffer, 10 );
_itoa( i2, buffer2, 10 );