0

practicing functions with C

Hello I keep getting this response when trying to practice functions with C: expected declaration specifiers or '...' before numeric constant What am I doing wrong? Thanks

27th Jul 2021, 11:13 PM
Sei
3 Respuestas
+ 2
Please show us the code you are having problems with
27th Jul 2021, 11:17 PM
Brain & Bones
Brain & Bones - avatar
+ 1
Inside main (line 36) The int before the function name makes the compiler think you want to declare the function, not use it, so it expects to see the argument names ( or '...' for variadic arguments) inside the parenthesis, but it sees a number and gives the error So, just get rid of that int Also, I sow you're using a very old and dangerous C syntax, just remember that those functions have no prototype, so be careful and try following the "modern" way more often
27th Jul 2021, 11:34 PM
Angelo
Angelo - avatar