标题:C++程序异常求解
只看楼主
xiaoxiliushu
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2013-12-28
结帖率:0
已结贴  问题点数:20 回复次数:3 
C++程序异常求解
//201.cpp

#include "stdafx.h"

using namespace System;
// Define the enumeration at global scope
enum class Month{January, February, March, April,
 May, June, July, August,
 September,October, November, December};

int main(array<System::String ^> ^args)
{
 Month month = Month::January;
 Console::WriteLine(L"Monthis {0} and the value is {1} ", month, safe_cast<int>(month));
 month = Month::February;
 Console::WriteLine(L"Monthis {0} and the value is {1} ", month, safe_cast<int>(month));
 month = Month::March;
 Console::WriteLine(L"Monthis {0} and the value is {1} ", month, safe_cast<int>(month));
 month = Month::April;
 Console::WriteLine(L"Monthis {0} and the value is {1} ", month, safe_cast<int>(month));
 month = Month::May;
 Console::WriteLine(L"Monthis {0} and the value is {1} ", month, safe_cast<int>(month));
 month = Month::June;
 Console::WriteLine(L"Monthis {0} and the value is {1} ", month, safe_cast<int>(month));
 month = Month::July;
 Console::WriteLine(L"Monthis {0} and the value is {1} ", month, safe_cast<int>(month));
 month = Month::August;
 Console::WriteLine(L"Monthis {0} and the value is {1} ", month, safe_cast<int>(month));
 month = Month::September;
 Console::WriteLine(L"Monthis {0} and the value is {1} ", month, safe_cast<int>(month));
 month = Month::October;
 Console::WriteLine(L"Monthis {0} and the value is {1} ", month, safe_cast<int>(month));
 month = Month::November;
 Console::WriteLine(L"Monthis {0} and the value is {1} ", month, safe_cast<int>(month));
 month = Month::December;
 Console::WriteLine(L"Monthis {0} and the value is {1} ", month, safe_cast<int>(month));
 return 0;
}
这个程序运行闪一下就退出了,我在后面加上system("PAUSE"),也不行,不识别system,不知道怎么办?
搜索更多相关主题的帖子: include 
2013-12-28 22:54
wangdayong99
Rank: 2
等 级:论坛游民
帖 子:9
专家分:97
注 册:2013-12-24
得分:7 
把return 0语句去掉
2013-12-29 18:41
rjsp
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:507
帖 子:8890
专家分:53117
注 册:2011-1-18
得分:7 
C++/CLI 和 C++ 毫无关系,你最好到.net论坛去问
2013-12-30 08:33
IceSource
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:37
专家分:139
注 册:2013-12-3
得分:7 
你试一下Ctrl+F5运行
2013-12-30 08:41



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-425838-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.217278 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved