I'm always glad to help, and it's nice to hear a "thank you" now and again.
:)
Jason.
----- Original Message -----
From: "Marton Rusk" <mar...@ho...>
To: <jas...@bt...>
Sent: Friday, October 26, 2001 4:21 AM
Subject: Re: [Dev-C++] newbie needs help
> WOW, yippeee! that fixed it, thank you! I been banging my head against the
> keyboard half the day trying to figure this out. I "thought" i put it
inside
> of main but i guess i didn't try it.
>
> Thank you!
>
> Marton D. Rusk
>
>
> >From: "Jason Hardman" <jas...@bt...>
> >To: "Dev-C++" <dev...@li...>
> >Subject: Re: [Dev-C++] newbie needs help
> >Date: Fri, 26 Oct 2001 04:09:25 +0100
> >
> >The commented code should be inside the main function, between the two
{}.
> >Also you need to qualify the scope of the flags in the first, so:
> >
> >cout << ios::fixed << ios::showpoint;
> >
> >Which will compile in Dev-C++, although I have noticed it outputs a weird
> >number, but I'll let you sort that out.
> >
> >The second commented code works fine (assuming you put it inside main()).
> >
> >The last won't work, but it's not needed as you should use ios:: and not
> >ios_base::
> >
> >I've attached some code for you to work with.
> >
> >Jason.
> >
> >----- Original Message -----
> >From: "Marton Rusk" <mar...@ho...>
> >To: <dev...@li...>
> >Sent: Friday, October 26, 2001 3:46 AM
> >Subject: [Dev-C++] newbie needs help
> >
> >
> > > Hello all,
> > >
> > > I'm a programming student currently in my C++ part 2 class.
> > >
> > > Please tell me why the following code gives me errors with any of the
> >three
> > > commented floating point formatting code un-commented? I get errors
with
> > > three different compilers.
> > >
> > > If anyone knows how to fix this please help. Or, if anyone knows
another
> >way
> > > to format floating point data please help.
> > >
> > > Thanks,
> > >
> > > Marton D. Rusk
> > >
> > >
> > > #include <iostream>
> > > #include <iomanip>
> > >
> > > using namespace std;
> > >
> > > //cout << fixed << showpoint; //don't work
> > >
> > > //cout.setf(ios::fixed, ios::floatfield); //don't work
> > > //cout.setf(ios::showpoint);
> > >
> > > //cout.setf(ios_base::fixed, ios_base::floatfield); //don't work
> > > //cout.setf(ios_base::showpoint);
> > >
> > > int main(){
> > >
> > > float number = 3.57890;
> > >
> > > cout << number;
> > > return 0;
> > > }
> > >
> > >
> > > _________________________________________________________________
> > > Get your FREE download of MSN Explorer at
> >http://explorer.msn.com/intl.asp
> > >
> > >
> > > _______________________________________________
> > > Dev-cpp-users mailing list
> > > Dev...@li...
> > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> ><< iomanipstuff.cpp >>
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
|