Dear friends:
I am writing a compuational fluid dynamics code with c++, and the procedure have many sub-functions to compute different quantities.
I want to defined a head file name as global.h to store all the globla variables, for example, the coordinates of grid points which will be used by ervery sub-functions.
Code:
global.h
double x[][];
double y[][];
............
................
..............
hear is another file to compute the distance between differnet points.
dis.cc
........
........
........
another one to compute the volume of each control volume.
vol.cc
......
.............
...........
the main file:
Code:
int main()
{
cout《x[][]<<y[][];
}
I tried to include the head file in each sub files, but it give me some error about "variabel re dine"
could you please tell me how to use the globa variable defined in the global.h file in every sub-functions and the main file.
Regards
Yours Sincerely.