|
-
April 25th, 1999, 03:28 AM
#1
Converting a string to int
Hi,
I have the variable char temp[8].
With this variable the user can enter a single character
or an 8 digit number.
When the user enters an 8 digit number I need to be able to convert
the variable into an int variable.
Does anyone know how to do this.
-
April 25th, 1999, 06:34 AM
#2
Re: Converting a string to int
You can use the standard C++ function 'atoi()' to convert a from char to int. In your case this would look something like this :
char temp[8];
... user entry stuff ...
int result = atoi(temp);
Good Luck, Pras
-
April 26th, 1999, 12:07 AM
#3
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|