+ 1
If you are talking about #define, it is just a way to set a constant for the rest of your program. This is used to make it easy to change a variable you use multiple times later by only having to modify one line of code at the top. For example: #define MAXSPEED = 100 would allow you to use MAXSPEED anywhere you wanted to use that variable later in the program. If a program that is calculating data for a car uses MAXSPEED in a bunch of formulas, and then one day you upgrade the car to be able to go 150, you now only need to change the define statement. If you didn't define the constant, you would have to go line by line and find every 100 and change to 150. Not only is this time consuming, it would be easy to miss one and your program would no longer work.
13th Oct 2016, 7:39 PM
Ryne
Ryne - avatar