Defining Variables with Fixed Values - C++ Data Type

C++ examples for Data Type:const

Introduction

You use the const keyword to create constant value.

For example:

Demo Code

#include <iostream>

int main()//from  w  w  w.  jav  a  2  s.co  m
{
    const unsigned int toe_count {2U};

    std::cout << "The value of toe_count is "  << toe_count  << std::endl;
}

Result


Related Tutorials