Originally Posted by
laserlight
It is fine as part of a function definition and will work with any standard conforming C compiler. Actually, it is also fine as part of a function declaration that is not a function definition, but then writing it as void disp(void); would then make it certain that disp does not have any parameters.
What exactly were the corrections that you made in the end? One of things to note is that you have a linker error: if you only compiled A.c, then that's where your problem lies. You should compile both source files and link them.
now files A.c ,B.c and header.h look like :
A.c
Code:
#include<stdio.h>
#include "header.h"
int main(void)
{
disp();
return 0;
}
B.c :
Code:
#include "header.h"
#include<stdio.h>
void disp(void)
{
printf("the disp function should work");
}
header.h :
Code:
#ifndef header_h_
#define header_h_
void disp(void);
#endif
thank you for the help