[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hpux-cxx-dev
Subject:    Re:  CXX-DEV: istrstream behavior??
From:       Dennis Handly <dhandly () hpcllmx ! cup ! hp ! com>
Date:       2000-08-26 0:24:27
[Download RAW message or body]

>and if the buf contains preceded 0 (zero), like "0078", and if I try to
>stream the object into a integer I get some unexpected results.
Raj

You have been hosed by nerds.  :-)
See istream(3).

>From: Christophe de Dinechin <ddd@cup.hp.com>
>The '0' prefix for numbers indicates octal.

You need to set the mode to strict decimal:  cin << dec();

The ANSI C++ Standard says that cin should be in decimal so there will
be no problems with the new library.

$ aCC -AA istr.c
$ a.out
12345
1088
32
78
$ aCC istr.c
$ a.out
12345
1088
26
7
 _________________________________________________________________
 To leave this mailing list, send mail to majordomo@cxx.cup.hp.com
    with the message UNSUBSCRIBE cxx-dev
 _________________________________________________________________

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic