Where should i declare the variables i like to use in windows forms?
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
int iMyvariable = 1;
}
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
iMyvariable++;
}
Running the code gives the following error:
error C2065: 'iMyvariable' : undeclared identifier