Mybowlcut
March 3rd, 2007, 05:43 AM
#include <iostream>
#include <iostream>
#include is a preprocessor directive.
string is a variable type.
Using a Constant Pointer to a Constant
A constant pointer to a constant combines the restrictions of a constant pointer and a pointer to a constant. This means that a constant pointer to a constant can only point to the object that it was initialised to point to. In addition, it can't be used to change the value of the object to which it points. Here's the declaration and intialization of such a pointer:
const int* const pBONUS = &BONUS; //a constant pointer to a constant
The preceding code creates a constant pointer to a constant named pBONUS that points to the constant BONUS.
Beginning C++ Game Programming - Michael Dawson
Using a Constant Pointer to a Constant
A constant pointer to a constant combines the restrictions of a constant pointer and a pointer to a constant. This means that a constant pointer to a constant can only point to the object that it was initialised to point to. In addition, it can't be used to change the value of the object to which it points. Here's the declaration and intialization of such a pointer:
const int* const pBONUS = &BONUS; //a constant pointer to a constant
The preceding code creates a constant pointer to a constant named pBONUS that points to the constant BONUS.
#include <iostream>
#include is a preprocessor directive.
string is a variable type.
Using a Constant Pointer to a Constant
A constant pointer to a constant combines the restrictions of a constant pointer and a pointer to a constant. This means that a constant pointer to a constant can only point to the object that it was initialised to point to. In addition, it can't be used to change the value of the object to which it points. Here's the declaration and intialization of such a pointer:
const int* const pBONUS = &BONUS; //a constant pointer to a constant
The preceding code creates a constant pointer to a constant named pBONUS that points to the constant BONUS.
Beginning C++ Game Programming - Michael Dawson
Using a Constant Pointer to a Constant
A constant pointer to a constant combines the restrictions of a constant pointer and a pointer to a constant. This means that a constant pointer to a constant can only point to the object that it was initialised to point to. In addition, it can't be used to change the value of the object to which it points. Here's the declaration and intialization of such a pointer:
const int* const pBONUS = &BONUS; //a constant pointer to a constant
The preceding code creates a constant pointer to a constant named pBONUS that points to the constant BONUS.