| Using VISA.NET > Formatted I/O > Using Printf > Printf Code Snippets > Formatting Characters |
A character argument has a format specifier of the following form:
%[flags][width][.precision]c
|
Modifier |
Interpretation |
|---|---|
|
Default Functionality |
The argument is interpreted as a single-byte character. The character is sent to the device without change. |
|
flags -, Q, q |
Controls justification and padding of the output, as follows:
|
|
width |
Minimum field width of the output string. An asterisk (*) may be present in lieu of an integer width modifier, in which case an extra Int32 argument supplies the value. |
|
precision |
Maximum number of characters to send. An asterisk (*) may be present in lieu of an integer precision modifier, in which case an extra Int32 argument supplies the value. |
Remember that Printf is adding characters to the formatted write buffer. The comments after each Printf call show what character(s) are added to the formatted write buffer by that call. Assume that the io variable is a valid reference to IMessageBasedFormattedIO.
| Example Title |
Copy Code |
|---|---|
io.Printf(_T("|%c|"), 'A'); // Adds |A| io.Printf(_T("|%5c|"), 'A'); // Adds | A| io.Printf(_T("|%-*c|"), 5, 'A'); // Adds |A | | |