[openbeos] Re: newbie problem

I'm a senior at college majoring in computer science.  I see this problem
all the time when helping first year students with the c++ programs.  There
are internal problems with cout and the use of precision() and some of the
other function that effect the display of numbers which result in it
crashing.  The only suggestion I have is to not call precision() or use my
version of the iostream library when I'm done with it (probably about 90%).
By the way, I rather negative opinions about the implementation of the
iostream   This would be the first time I've seem this happen in BeOS.  Hmm,
well it's also the first time I know someone to call precision() in BeOS.


Scott MacMaster

----- Original Message -----
From: "Andre Stark" <An.Stark@xxxxxx>
To: <openbeos@xxxxxxxxxxxxx>
Sent: Saturday, December 14, 2002 11:21 AM
Subject: [openbeos] newbie problem


> hello together,
> until this time i only used beos. no i would like to start some
programming.
> first time in beos and also in c++.
> . an extract of my problem is the following piece of code:
>
> # include <iostream>
> using namespace std;
>
> int main() {
>   int x;
> float a;
> double b;
> x=10;
> a=10.12345678901234567890;
> b=10.12345678901234567890;
> cout << "\n" << x << "\n";
> cout << "\n" << a << "\n";
> cout << "\n" << b << "\n";
> cout.precision(16);
> cout << "\n" << a << "\n";
> cout << "\n" << b << "\n";
> return 0;
> }
>
>  running from console with "g++ file.cpp"
> there is no error message, but when running the executable i get an
> error. debugger is telling me this:
>
> loading symbols
> segment violation occurred
> __overflow:
> __overflow:
> +0023  ec04ce77:   *        14408b    movl    0x00000014(%eax), %eax
>
> im new, firstly in programming c++, second in programming beos apps,
> so i don't really know what kind my problem ist, but will really be
> happy for some help.
> thanks all
>   andre
>
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.427 / Virus Database: 240 - Release Date: 12/6/2002


Other related posts: