C++ examples for File Stream:cout
Specifying formats with manipulators, number formatting in decimal, octal, and hexadecimal.
#include <iostream> using namespace std; int main() {//from ww w .j a v a 2s . c o m cout << "a number in decimal: " << dec << 15 << endl; cout << "in octal: " << oct << 15 << endl; cout << "in hex: " << hex << 15 << endl; cout << "a floating-point number: " << 3.14159 << endl; cout << "non-printing char (escape): " << char(27) << endl; }