Title: | C++ |
Notice: | Read 1.* and use keywords (e.g. SHOW KEY/FULL KIT_CXX_VAX_VMS) |
Moderator: | DECCXX::AMARTIN |
Created: | Fri Nov 06 1987 |
Last Modified: | Thu Jun 05 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 3604 |
Total number of notes: | 18242 |
Hi, Am I doing something wrong? I would like to be able to do things like #include ints . . . uint32 status; status = sys$get...; cout << "Status = " << status << endl; . . But it does not compile. I always need to cast the status to int cout << "Status = " << (int)status << endl; Is there an easy way to achieve this, because I seem to forget the cast very often? C++ V5.5 OpenVMS Alpha V7.1 Any help with this minor irritation appreciated Paul
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
3450.1 | special int types and iostreams | DECC::J_WARD | Fri Feb 14 1997 10:06 | 14 | |
I'm not sure why the special int types were never added to the set of overloaded operator << and operator >> in the iostream class library, perhaps it was because they are non-standard types and we wanted to keep the library consistent across all platforms... we'll consider it... In the meantime, you can always define your own operator <<, i.e.: // add this to your own code inline ostream& operator<<(ostream& os, uint32 i) { return os << (int) i; } |