Closed omoikhekpen closed 4 years ago
Basically, what C is trying to tell you is that according to the function definition
over here, int get_int(const char *format, ...) attribute((format(printf, 1, 2)));
, it is expecting you to give it an argument that it calls format
, so it's actually expecting you to give it a single argument so the function can work properly as expected.
The error you made is that you didn't give it any arguments at all, here h = get_int();
. As you can see, the const char
in the function definition exists, which basically means right now is that it wants a string
from you, just like you give printf
a string, so that the function can use that string to do something that it needs to.
This is not a CS50 issue, though. Please read about function definition
and function prototypes
in C if you still don't get it.
Other than that, maybe close this issue now?
Please refer to https://man.cs50.io/#cs50.h or run man get_*
(e.g., man get_int
) for example usages.
i have an issue with compiling this program
include
include
int main(void) { // ask for a number int h = 0; printf("Height: "); h = get_int();
}
it keeps giving me this error mario.c:9:17: error: too few arguments to function call, at least argument 'format' must be specified h = get_int();