| Physics and Astronomy |
Back to top
Another #define exampleOur previous example of using fopen() had an issue in that the file name "highscore.txt" appeared twice. If we ever wanted to change it we would have had to change it twice and the danger is that we would miss one out.Here is one solution using #define which demonstrates that it can be used for text strings as well as mathematical constants. The changes are shown highlighted. |