I've got aud.ccp
, aud.h
, geist.ccp
, geist.h
. In geist.ccp
I've got a variable which needs to get to aud.ccp
.
If I got:
int x = 5;
in geist.ccp
, how can I achieve it, that a 8
gets represented in the console when I use
cout << x+y << endl;
as well as
cin >> y; // ofc I enter 3 here.
in aud.ccp
.
Edit: I wrote:
int x
in the public part of geist.h and I wrote:
x = 5;
in geist.cpp. Finaly I wrote
extern int x;
in aud.cpp
But somehow I do not get the result I want