delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/14/19:33:12

Message-ID: <n1343223731.73452@jpl-335-server.jpl.nasa.gov>
Date: 14 Jul 1997 16:44:08 -0800
From: "Courtney Duncan" <Courtney.Duncan.JPL#u#335#u#QMAIL AT jpl-335-server DOT jpl DOT nasa DOT gov>
Subject: cout << (double)
To: "djgpp list" <djgpp AT delorie DOT com>
Mime-Version: 1.0

Mail*Link® SMTP               cout << (double)

I'm using a version of gcc that was unzipped from files like gcc263bn.zip that I got on a Walnut Creek CD-ROM dated February 1996.  I'm trying to develop C++ applications on a DOS platform.

When I do

cout << 4;

I get "4" on the screen.

When I do

cout << 4.5

I get "0.//////" on the screen.

When I do

cout << (float) 4.5;

I get "NaN" on the screen.

I've tried writing my own overload of

ostream &operator << (ostream&, double)

but can't get it to link this instead of the library version

I'm compiling using

gcc -c util.cpp

and linking using

gcc -g main.o util.o [other stuff].o -o <myprogram> -lgpp

Am I not using the right library?

Looks to me like the support or ostream doubles and other non integer, non string types is incomplete or I'm somehow using it incorrectly.

What is to be done?

Courtney DOT Duncan AT Jpl DOT Nasa DOT Gov


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019