S
silversurfer2025
Hello everyone,
once again, I have a very basic problem in C++, which I was not able to
solve (maybe because of my Java-Experience or just because it is always
the small syntax-things which break my neck in C++)...
I would like to have a static variable in class A and change its value
from class B (they are not related to each other)
For example:
class A {
poublic:
std:
air <int,int> test
}
class B{
poublic:
void testing();
}
void B::testing() {
std::cout (A::test).first;
A::test = std::make_pair(1,1);
}
If I write it as above, I always get undefined reference to
`A::test'... How should I do it?
Greetings
Tim
once again, I have a very basic problem in C++, which I was not able to
solve (maybe because of my Java-Experience or just because it is always
the small syntax-things which break my neck in C++)...
I would like to have a static variable in class A and change its value
from class B (they are not related to each other)
For example:
class A {
poublic:
std:
}
class B{
poublic:
void testing();
}
void B::testing() {
std::cout (A::test).first;
A::test = std::make_pair(1,1);
}
If I write it as above, I always get undefined reference to
`A::test'... How should I do it?
Greetings
Tim