You can declare a scanf function with
extern int scanf(const char *format, ...);
The extern keyword is optional, but I like to include it as a reminder that a function is defined elsewhere.
Your example would look like this:
extern int scanf(const char *format, ...); int main () { char str [80]; scanf ("%s",str); return 0; }
source share