I have slimmed my problem down to the following code:
#include <iostream>
using namespace std;
struct hello
{
int array[4];
array[0] = 1;
array[1] = 2;
array[2] = 3;
array[3] = 4;
};
And when I compile this I still get the ‘array does not name a type’ error, on every line where I assign a value.
AFAIK this error is caused when a variable is nto declared, even though I declare array right above the assignment.
Assignment statements like array[0] = 0; cannot go into the struct definition, the need to go into an executable block of code like a function, a constructor or similar.