Your question is "In which C++ compilers can I assign values to struct variables".
My answer is "from all compilant c++ compilers, conforming to c++98 forward". All allow struct data attributes to be initialized.
The following works even when I set my compiler option std=c++98
What it does is avoid the C++11 feature and moves the data attribute initialization into a user defined default ctor.
struct Players
{
int Health;
int Mana;
int Experience;
Players() : Health(100), Mana(120), Experience(0)
{
}
// an array of Cn Players will build Cn copies,
// all initialized to these same 3 values of the default ctor.
};
Yes, your code struct does have a compiler provided ctor (and a few other method attributes.)
And yes, I suppose you don't really want to use c++98.
update
The following is yet another default ctor, though it may not look like it.
struct Players
{
int Health;
int Mana;
int Experience;
Players(int aHealth=100, int aMana=120, int anExperiance=0) :
Health(aHealth), Mana(aMana), Experience(anExperience)
{
}
};
This is default ctor because you can invoke it as "Players players();", and all the method defaults will apply.
You may control what the compiler provides for your struct/class by using the "= delete." statement.
The methods you can order the compiler to not provide
// coding standard: disallow when not used
T(void) = delete; // default ctor (1)
~T(void) = delete; // default dtor (2)
T(const T&) = delete; // copy ctor (3)
T& operator= (const T&) = delete; // copy assignment (4)
T(const T&&) = delete; // move ctor (5)
T& operator= (const T&&) = delete; // move assignment (6)
Just replace T your class name (i.e. Players)
Remember, you disallow when you want to not have one of these methods. Do not disallow if you provide an alternative to the compiler provide method.