[问题] Windows form全域变量

楼主: skitty (aki)   2016-01-12 11:44:56
开发平台(Platform): (Ex: VC++, GCC, Linux, ...)
c++2010 Windows form
问题(Question):
我想要宣告一个全域用的变量和阵列
上网查资料在.h档试了以下几种:
1. Form1 底下宣告 int i
2. Form1底下宣告 int A[10]
3. Form1底下宣告 array<int^>^ Arry= gcnew array<int^>(10)
4. namespace底下宣告
public class A{
public: static int a1;
static int b1[10];
};
但是在.cpp档main中都无法呼叫
ex 打Form1::i会说是不合法的
想请问是我宣告有误还是呼叫有误…
作者: kwpn (ITSST)   2016-01-12 21:06:00
int i没宣告成static

Links booklink

Contact Us: admin [ a t ] ucptt.com