Visual c++ 在VisualC++; 这是我的问题,如何从VisualC++中的文本框输入字符串解析。我有这样一个项目,我的投入需要一年。无论是闰年还是非闰年,该计划都会在标签上给出结果。我对C++/CLI很在行,但Visual有点不同。这里真的需要帮助
以下是部分代码:Visual c++ 在VisualC++; 这是我的问题,如何从VisualC++中的文本框输入字符串解析。我有这样一个项目,我的投入需要一年。无论是闰年还是非闰年,该计划都会在标签上给出结果。我对C++/CLI很在行,但Visual有点不同。这里真的需要帮助,visual-c++,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) {
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";
}
请看一看.NET类如何从一种类型转换为另一种类型。如果您能给我举个例子,我更喜欢。