Asslam Alekom ...Brother...
I did not realy get what you meant when you said :
some functions in a.cpp like( int counter; int there
first these are variables not functions.
any way the solution to your problem is ::
when you write funtions in a file and you want to use these funtions you have to save this file with the extention .h (like a.h) which means that you try to make it as a liberary.
Then, when you write the second file and you wnat to include the first file in your second file you have to write in the first lines before the main funtion this line ....[COLOR=green]#include "a.h"[/COLOR [
((وَاتَّقُوا يَومًا تُرجَعُونَ فِيهِ إِلَى الله ثُمَّ تُوَفَّى كُلُّ نَفسٍ مَّا كَسَبَت وَهُم لاَ يُظلَمُونَ))