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