TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALL
from: JO GERAERTS
date: 1998-03-16 17:35:00
subject: convert char to int...

Hello All !
In a program I want to use a ini file. I've got a predefined function that 
reads the value and stores it in a string (char str[2])
But the value is a number is an I want to convert it to a integer. How can I 
do that. I tried this:
int x=(int)str;
I also tried this:
int x=(int)*str
But if for example value=10 then x becomes something else. How can I convert 
it without changing the value?
Greetzzz,
Jo Geraerts
Fido: 2:292/120.121
E-mail: Geraerts@mail.dma.be
URL: http://bewoner.dma.be/Geraerts/index.htm
---
---------------
* Origin: DiGiTal ConTacT pint 121 (2:292/120.121)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.