//main.cpp
#include "B.h"
int main()
{
foo1();
}
#ifndef A_H
#define A_H
//this is a declaration
void foo();
#endif
#ifndef B_H
#define B_H
//this is a declaration
void foo1();
#endif
#include "A.h"
//this is the implementation
void foo()
{
//do something
}
#include "A.h"
//this is implementation
void foo1()
{
foo();
//do something else
}