TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: ADAM MAJER
from: DARIN MCBRIDE
date: 1998-03-19 19:31:00
subject: atoi(const char .s)

SL>int main(void)
SL>  {
SL>    char *sTemp;
SL>    int iTemp;
 AM> sTemp = (char*)malloc(sizeof(char)*256); <- enough space for 256 digits!
Space for 255 plus the nul.  However...
Rather a bit of overkill since 16-bit ints can only have 5 bytes (plus the 
nul) = 6.  ;-)
SL>    printf("Enter a number: ");
SL>    scanf("%s", sTemp);
 AM> NULL pointer!!!!! Causes lot's of run-time errors. You must allocate the
 AM> memory before using it.
Nope NOT NULL pointer!!!!  _RANDOM_ pointer.  :-)
---
---------------
* Origin: Tanktalus' Tower BBS (1:250/102)

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