So I have test.h
which contains:
#ifndef TEST_H_
#define TEST_H_
class test {
public:
int value;
};
#endif /* TEST_H_ */
and my main.cpp
:
#include "test.h"
class Magic {
test x;
x.value = 2; // Syntax error
};
int main () {
test y;
y.value = 2; // Works fine
return 0;
}
Why is this happening?