Cryptography Reference
In-Depth Information
Table 15-3. LINT flags for output formatting and their effects
Flag
Value
lintdec
0x010
lintoct
0x020
linthex
0x040
lintshowbase
0x080
lintuppercase
0x100
lintbin
0x200
lintshowlength
0x400
We shall now clarify the use of the format functions and manipulators by
means of the following example:
#include "flintpp.h"
#include <iostream.h>
#include <iomanip.h>
main()
{
LINT n ("0x0123456789abcdef"); // LINT number with base 16
long deflags = LINT::flags(); // store flags
cout << "Default representation: " << n << endl;
LINT::setf (LINT::linthex | LINT::lintuppercase);
cout << "hex representation with uppercase letters: " << n << endl;
cout << LintLwr << "hex representation with lowercase letters: " << n << endl;
cout << LintDec << "decimal representation: " << n << endl;
cout << LintBin << "binary representation: " << n << endl;
cout << LintNobase << LintHex;
cout << "representation without prefix: " << n << endl;
cerr << "Default representation Stream cerr: " << n << endl;
LINT::restoref (deflags);
cout << "default representation: " << n << endl;
return;
}
15.3.3 File I/O for LINT Objects
Functions for the output of LINT objects to files and functions for reading them
are unavoidable for practical applications. The input and output classes of the
 
Search WWH ::




Custom Search