Subj : Re: Writting hex to a stream To : borland.public.cpp.borlandcpp From : maeder Date : Sat Mar 12 2005 07:22 am "John Vaughn" writes: > Sorry for the dumb question, but I've got a brain freeze. How do I write an > int to a stream in hexadecimal? Using the hex manipulator. In Standard C++, this looks like this: #include #include int main() { std::ofstream f("outfile"); f << std::hex << 22 << '\n'; } % cat outfile 16 IIRC, you'll have to make slight modifications (like removing the std:: and prefixing the #included header names with .h) to make it work. .