TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: JO GERAERTS
from: MARIO SEMO
date: 1998-03-27 10:33:00
subject: convert char to int...

Hallo Jo!
Antwort auf eine Message von Jo Geraerts an All:
 JG> In a program I want to use a ini file. I've got a predefined function
 JG> that reads the value and stores it in a string (char str[2]) But the
mh. a) what is a 'ini' file?? can;t find this in my ARM.
     b) assume an ini is a data storage. what format is the data stored?
         hex? as string?
         if hex: what is sizeof(string). on my 2 machines : one said 32, one 
said 64. 
         if string : "1234" also needs more then 2 bytes.
 JG> value is a number is an I want to convert it to a integer. How can I
 JG> do that. I tried this:
 JG> int x=(int)str;
this stores the address of str as int converted to x.
 JG> int x=(int)*str
this converts the FIRST character (str[0]) to an int and stores it to x.
if the data is hex: int x(*(int *)str);
if the data is a string : int x(atoi(str));
Servus, Mario!
--- FleetStreet 1.21 PR#2
2:310/14.11)
---------------
* Origin: LC/32 Development Team, KirchnerSoft, Vienna, Austria

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™.