The problem is not the {
per se, that's just where the compiler finds a problem. The problem is the ;
. If program is defining a function prototype the ;
would be necessary (and the function logic would come later in the program). Since main
is the main loop of the program the correct declaration is
int main(void) {
FYI if you expand the Source Code option under the lecture on the class page, and choose Index, you can download any/all the sources from the lecture.