Say I have a main.c file and a add.c file, and I include add.c in main.c as so :
main.c
#include <stdio.h>
#include "add.c"
int add(int a, int b);
int main(int argc, char const *argv[])
{
printf("%d", add(1, 2));
return 0;
}
add.c
int add(int a, int b){
return a + b;
}
do I actually need to forward declare int add(int a, int b) before calling the function add() ? Because without declaring it first it still compiles without an issue and that's bugging me a bit, maybe I am mistaking the way c works with c++ ?