I have been trying to debugg the program for a while but am not able to figure out what the error in line 9 is as this was the code provided by the courses and I didn't make any changes. Any help would be appreciated. Thank you in advance.
2 Answers
I compared your code to my and found the case of error.
When you declare constant in C, you should do like this: #define {name of constant} {number}
Without semicolons by the way.
-
The way that they declared the constants in this code is correct. It's explained in the week 2 lecture. Your answer is actually declaring a macro. Here's a reference that explains it in detail. geeksforgeeks.org/different-ways-declare-variable-constant-c-c– Cliff BCommented Nov 2, 2021 at 18:08
The problem with line 9 is syntax. This is a function declaration. It has square brackets where it should have parentheses.
BTW, there's nothing wrong with the const declarations.
If this answers your questions, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)