| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Tutorial questions? |
RS> I've never used const; I don't see much of a use for it. RS> I suppose it's handy as a sort of extra protection RS> measure when you have a runtime value you want to set RS> once and leave alone, but... Microsoft makes extensive use of constants in their Visual programming languages. In Visual Basic, for instance, you find vbRed, vbGreen, etc., for the standard RGB values of the basic sixteen colors used in EGA/VGA systems. VC++ has many constants defined for similar purposes, such as vk_Escape, vk_Tab, or vk_Shift. These are useful aids in making your code more readable when processing constant values. You will also see these done using the enum preprocessor command, which produces essentially the same results, as far as producing constant variables for use in your program is concerned. I think that the enum is more commonly used, since you generally want to use constant values for a number of related values, essentially to make the code more readable. The purpose of making a value a const is to keep your code, ( or someone else's ), from accidentally changing the value of a variable designed as a self-documenting constant value to be used only for comparison and assignment. > ]* Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750) SEEN-BY: 396/1 632/0 371 633/260 267 270 371 634/397 635/506 728 810 639/252 SEEN-BY: 670/218 @PATH: 154/750 222 396/1 633/260 635/506 728 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.