w***g 发帖数: 5958 | 1 不想自己定义一堆exception类.STL有没有什么可以直接用的,比如用下面的语句
throw SomeStandardException("something failed"); |
c**a 发帖数: 316 | 2 throw exception("ooooooops");
【在 w***g 的大作中提到】 : 不想自己定义一堆exception类.STL有没有什么可以直接用的,比如用下面的语句 : throw SomeStandardException("something failed");
|
w***g 发帖数: 5958 | 3 STL中的exception明显不能这么用.
【在 c**a 的大作中提到】 : throw exception("ooooooops");
|
c**a 发帖数: 316 | 4 无语了。
【在 w***g 的大作中提到】 : STL中的exception明显不能这么用.
|
t****t 发帖数: 6806 | 5 namespace std {
class logic_error;
class domain_error;
class invalid_argument;
class length_error;
class out_of_range;
class runtime_error;
class range_error;
class overflow_error;
class underflow_error;
}
【在 w***g 的大作中提到】 : STL中的exception明显不能这么用.
|
c**a 发帖数: 316 | 6 大牛啥意思?
这些都是 exception 的之类哇?
别说我错了。我都很没自信了。
【在 t****t 的大作中提到】 : namespace std { : class logic_error; : class domain_error; : class invalid_argument; : class length_error; : class out_of_range; : class runtime_error; : class range_error; : class overflow_error; : class underflow_error;
|
t****t 发帖数: 6806 | 7 你当然错了, 把自己的代码试试编译一下总会的吧, 这还要人说?
【在 c**a 的大作中提到】 : 大牛啥意思? : 这些都是 exception 的之类哇? : 别说我错了。我都很没自信了。
|
c**a 发帖数: 316 | 8 ....
完了。 彻底不会了。 我一直这么用的, 一直好好的哇。 不但编译过, 还测试过呢。
cout << "Enter length for array 1";
stringstream ss;
int i;
string s("hi I like u");
string::iterator it_begin = s.begin();
string::iterator it_end = s.end();
//printdoubletillq();
do
{
ss.clear();
cin >> s;
ss.str(s);
try{
if(!(ss >> i))
【在 t****t 的大作中提到】 : 你当然错了, 把自己的代码试试编译一下总会的吧, 这还要人说?
|
c**a 发帖数: 316 | 9 如题
呢。
【在 c**a 的大作中提到】 : .... : 完了。 彻底不会了。 我一直这么用的, 一直好好的哇。 不但编译过, 还测试过呢。 : cout << "Enter length for array 1"; : stringstream ss; : int i; : string s("hi I like u"); : string::iterator it_begin = s.begin(); : string::iterator it_end = s.end(); : //printdoubletillq(); :
|
y*******g 发帖数: 6599 | 10 c++可以throw任何东西阿.
不一定要exception类的
【在 w***g 的大作中提到】 : 不想自己定义一堆exception类.STL有没有什么可以直接用的,比如用下面的语句 : throw SomeStandardException("something failed");
|
t****t 发帖数: 6806 | 11 你的编译器太次
拿gcc试试, 过不去的
呢。
【在 c**a 的大作中提到】 : .... : 完了。 彻底不会了。 我一直这么用的, 一直好好的哇。 不但编译过, 还测试过呢。 : cout << "Enter length for array 1"; : stringstream ss; : int i; : string s("hi I like u"); : string::iterator it_begin = s.begin(); : string::iterator it_end = s.end(); : //printdoubletillq(); :
|
s******n 发帖数: 21 | 12 The constructors exception(const char * const &message) and exception(const
char * const &message, int) are Microsoft extensions to the Standard C++
Library.
【在 t****t 的大作中提到】 : 你的编译器太次 : 拿gcc试试, 过不去的 : : 呢。
|
c**a 发帖数: 316 | 13 原来如此。。。
const
【在 s******n 的大作中提到】 : The constructors exception(const char * const &message) and exception(const : char * const &message, int) are Microsoft extensions to the Standard C++ : Library.
|