The const type transforms an object into a constant.

Example 1

const int bufSize = 512;     // input buffer size
bufSize = 0; // error: attempt to write to const object
const int i, j = 0;  // error: i is uninitialized const
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.