I am a complete beginner and have been taking youtube lessons on C. However I am stuck with a very basic error (I assume) and would appreciate an explanation of why I am getting this error:
I haven't tried any fixes as I have no clue - being a complete beginner.
#include <stdio.h>
#include <stdlib.h>
int main()
{
sayHi();
return 0;
}
void sayHi()
{
printf("Hello User");
}
f.c:6:5: error: implicit declaration of function 'sayHi' is invalid in C99 [-Werror,-Wimplicit-function-declaration] sayHi(); ^ f.c:11:6: error: conflicting types for 'sayHi' void sayHi() ^ f.c:6:5: note: previous implicit declaration is here sayHi(); ^