Constants in C Programming Language: Primary & Secondary

Posted on January 25, 2010

Constants in C Programming Language

The keyword const can be added to the declaration of an object to make that object a constant rather than a variable.

The general syntax of constant declaration is :

Const data-type name = value;

Here const is known as a keyword that must be used to declare a constant.  Name is the name of the constant, data-type is the type of the data which we are declaring and value is the constant value of the data-type.

For example :

Const int manager_id=001;

Here we declared a constant named as manager_id of type integer which is assigned a value 001.

Types Of Constants:

C constants can be divided into two categories :

  • Primary constants
  • Secondary constants

Primary constants are further divided into :

  • Integer constants
  • Real constants
  • Character constants

Secondary constants are further divided into :

  • Array
  • Pointers
  • Union
  • Structures
  • Enum etc

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

Looking for a Fresher Job? Post Your Resume Free !!!

More Articles From "C Programming" Category

home | top

TopOfBlogs