Archive

Archive for the ‘c language constants’ Category

Declared constants (const)

July 27th, 2010 c# No comments

With the const prefix you can declare constants with a specific type in the same way as you would do with a variable:

const int pathwidth = 100;
const char tabulator = ‘\t’;

Here, pathwidth and tabulator are two typed constants. They are treated just like regular variables except that their values cannot be modified after their definition.

Categories: c language constants Tags: