Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

3.11 Arrays of Signed and Unsigned Chars

Manipulation ofarrays of bytes (signed or unsigned chars) is provided by the classes RWMathVec<T>, RWGenMat<T>, and RWMathArray<T>. Two typedefs are used:

For applications requiring only small integers, these classes may be used for high efficiency and compactness. They are also very useful for storing and manipulating graphical images and 8-bit data streams from A/D converters, digitizers, and so on. This makes it easy to take a 2-dimensional Fourier transform of a graphical image, for example:

Notice that we use the integer representations of the elements for input/output of vectors of signed or unsigned chars, not the literal character constants. This can differ from the behavior of your compiler when a single element is printed on an output stream. For example, the code:

prints $ with most compilers. However, the code:

always prints 36 36 36 with Math.h++. This is because the vector classes are primarily a tool for manipulating numbers, not strings. The Tools.h++ class RWCString should be used for manipulating strings.


Previous fileTop of DocumentContentsIndexNext file

©Copyright 1999, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.