0
这是我的问题,如何从Visual C++中的文本框输入解析字符串。我有这样的项目,我的投入需要一年。该程序将在标签中给出结果,不管它是否是闰年。我擅长C++/CLI,但Visual有点不同。这里真的需要帮助。从Visual C++的文本框输入中解析字符串
下面是部分代码:
String^year;
year = textBox1->Text;
// The code for parsing will be put here
bool isLeapYear = ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0));
if (isLeapYear)
{
label1->Text="Is a leap year";
} else
label1->Text="Is not a leap year";
}
我更喜欢如果你能给我一个例子。 – 2013-03-05 07:34:14