Fred Cole wrote in a message to Cliff Rhodes:
CR>> class KeyState {
CR>> private:
CR>> const char far *ks; // Pointer to BIOS keyboard flag
CR>> []
CR>> }
EW> Shouldn't that be
EW> const volatile char far *ks;
EW> since the flag can be changed by external causes (like the user)?
FC> Shouldn't that be
FC> volatile char far * const ks;
I don't know enough about the BIOS keyboard flag to comment on stripping the
const modifier (is that the right word?) off of char. If a program is allowed
to change the keyboard flags, ``const'' would be redundant, perhaps even too
restictive.
Adding a const modifier to the pointer is a good idea. However, it is not
strictly necessary, since ks is a private member.
Perhaps making the pointer static would a be good idea too, since there's
only one BIOS keyboard flags byte.
Bye,
Erik
---
---------------
* Origin: WarmelinkE@vertis.nl (2:282/608.60)
|