Mail Archives: djgpp/1994/09/14/03:22:44
Hi,
Can the named enumeration be implemented in DJGPP? For example, when
I compile the small program below:
enum bool {false, true};
void main () {
bool foo = false;
}
the g++ told me:
temp.cc:1: parse error before `bool'.
Another question is that: I want to print out the hexidecimal code
using cout, like that: (referenced to the book "The C++ Programming
Language," Bjarne Stroustrup, 2nd, p54)
#include <iostream.h>
void main () {
char ch;
while (cin >> ch)
cout << hex(ch);
}
and it did not work. After that I use the following codes:
#include <iostream.h>
const MASK = 0xff;
void main () {
char ch;
while (cin >> ch)
cout << hex << (MASK & ch);
}
then it fits I want.
Any comments about the above questions? Thanks in advance.
Regards,
Chun-Yu Lee
d791013 AT c2 DOT hinet DOT net
- Raw text -