C plus plus programming
June 3, 2026 1 min read

Symbolic Constants in C++: const Keyword and enum Keyword

HS
HEMANT SINGH
Technical Writer & Educator

In c++, there are two way to create symbolic constant.

 

  1. using const keyword
  2. using enum keyword

 

using const keyword

const float pi=3.14;

 

using enum keyword

enum GameLabels{
	Label1, Label2, Label3
}

By default all label has default value 0,1,2 and so on.

In this category