How to declare an int array within a managed class?

I'm using Visual Studio to make a tic tac toe game. I have it working great, but many things are hardcoded using multiple functions, when i could just make 1 function to handle them all. Anyway, what I need to do is simply make an array within the Form1 class.

I've tried this:
1
2
3
4
5
public ref class Form1 : public System::Windows::Forms::Form
	{
	public: int bval[9];
        ...
        };


And got this:
error C4368: cannot define 'bval' as a member of managed 'tictactoe::Form1': mixed types are not supported


I can't find any info on declaring an unmanaged variable in a managed class.
Last edited on
try using

array<int> ^bval;

and initialize it in your constructor with

bval = gcnew array<int>(9);
Topic archived. No new replies allowed.