If Wait() and main() are in the same file as you show in the first example above, then you don't need a header file. Yes, you could create a header file even if they are in the same file, in preparation to add more functions and more .c files.
If Wait() is in a separate file, then the prototype (declaration) for Wait() should be placed in the header file, and #include in both files.
If you print out an unsigned int, then use "%u" to display.
foo.c
Code:
#include<stdio.h>
#include"header.h"
int main (void)
{
Wait ( 2);
return 0;
}
file1.c
Code:
#include<stdio.h>
#include"header.h"
void Wait ( unsigned int size )
{
unsigned int i;
for ( i = 0; i < size; i++)
{
printf(" Loop = %u \n", i);
}
}
header.h
Code:
void Wait ( unsigned int size );