ไม่มีประเภทของค่าคงที่ใน C++ เพียงแต่คุณสามารถประกาศชนิดข้อมูลใดๆ ใน C++ ให้เป็นค่าคงที่ได้ หากตัวแปรถูกประกาศเป็นค่าคงที่โดยใช้คีย์เวิร์ด const คุณจะไม่สามารถกำหนดค่าใหม่ได้
ตัวอย่าง
#include<iostream>
using namespace std;
int main() {
const int i = 5;
// Now all of these operations are illegal and
// will cause an error:
i = 10;
i *= 2;
i++;
i--;
//...
return 0;
}