When trying to compile my mario.c and greedy.c programs, Clang compiler error messages indicate that a semicolon is needed after int main(void)
.
The C book that I am using (i.e., C Step by Step by Mitchell Waite and Stephen Prata ,SAMs 1989) does not indicate that a semicolon is required after main()
's signature. Incidentally, that book examples just start with main ()
.
If we didn't put a semicolon after main()
's signature though, Clang compiler prints the following error messages:
greedy2.c:4:2: error: type specifier missing, defaults to 'int'
[-Werror,-Wimplicit-int]
main()
^~~~
greedy2.c:4:8: error: expected ';' after top level declarator
main()
^
;
greedy2.c:7:4: error: expected identifier or '('
{
^
greedy2.c:27:14: error: initializer element is not a compile-time constant
int i = round (change*100) ;
^~~~~~~~~~~~~~~~~~
greedy2.c:29:6: error: expected identifier or '('
{
^
5 errors generated.
jharvard@appliance (~/Dropbox/pset1):
uma1966