This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
numeric_limits problem
- To: egcs at cygnus dot com
- Subject: numeric_limits problem
- From: Iztok Polanic <ssdipola at guest dot arnes dot si>
- Date: Sun, 6 Sep 1998 12:36:50 +0200 (MET DST)
- Organization: IBM.net
- Reply-To: Iztok Polanic <ssdipola at guest dot arnes dot si>
Hello !!!
I want to compile this program with egcs, but I get an error.
#/usr/local/bin/g++ 3.3.cpp -o test
3.3.cpp: In function `int main()':
3.3.cpp:9: `numeric_limits' undeclared (first use this function)
3.3.cpp:9: (Each undeclared identifier is reported only once
3.3.cpp:9: for each function it appears in.)
3.3.cpp:9: parse error before `>'
3.3.cpp:14: confused by earlier errors, bailing out
and here's the program
#include <iostream.h>
#include <limits.h>
using namespace std;
int main()
{
cout << endl
<< "The range for type short is from "
<< numeric_limits<short>::min()
<< " to "
<< numeric_limits<short>::max();
cout << endl
<< "The range for type int is from "
<< numeric_limits<int>::min()
<< " to "
<< numeric_limits<int>::max();
cout << endl
<< "The range for type long is from "
<< numeric_limits<long>::min()
<< " to "
<< numeric_limits<long>::max();
cout << endl
<< "The range for type float is from "
<< numeric_limits<float>::min()
<< " to "
<< numeric_limits<float>::max();
cout << endl
<< "The range for type double is from "
<< numeric_limits<double>::min()
<< " to "
<< numeric_limits(double>::max();
cout << endl
<< "The range for type long double is from "
<< numeric_limits<long double>::min()
<< " to "
<< numeric_limits<long double>::max();
cout << endl;
return 0;
}
This program should be ANSI/ISO compliant and egcs is ANSI/ISO compliant.
Right? So why doesn't it work??
Bye.
//////
xxxxxx ( o o )
xx xx /------------oOO-----O-----OOo------------\
xx xx | From: Iztok Polanic |
xxxx | E-mail: Iztok.Polanic1@guest.arnes.si |
xx xx | WWW: http://kotzi.home.ml.org |
xx xx | http://www.intering.si |
xx xx | ICQ: Kotzi => *12556824* |
\-----------------------------------------/