home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!mcsun!sunic!aun.uninett.no!nuug!nntp.uio.no!rujo
- From: rujo@ulrik.uio.no (Rune J|rgensen)
- Subject: sscanf and portability
- Message-ID: <RUJO.92Sep14160231@ulrik.uio.no>
- Sender: news@ulrik.uio.no (Mr News)
- Nntp-Posting-Host: ulrik
- Organization: University of Oslo, Norway
- Date: Mon, 14 Sep 1992 15:02:31 GMT
- Lines: 19
-
- If you use types that explisit defines a byte size, e.g.:
-
- typedef short INT16;
- typedef long INT32;
-
- INT16 i16;
- INT32 i32;
-
- How do you preserve portability with sscanf? E.g:
-
- sscanf(s, "%hd %ld", &i16, &i32);
-
- will work in this case, but not when long is implemented as 64 bit. (E.g.
- int is 32 bit, then; typedef int INT32;).
-
- Any suggestions?
-
- -Rune Jorgensen
- rujo@ulrik.uio.no
-