numeric_limits problem

Iztok Polanic ssdipola@guest.arnes.si
Sun Sep 6 05:40:00 GMT 1998


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*      |
                       \-----------------------------------------/





More information about the Gcc mailing list