2004-10-28 | 9:45:33 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 第二个问题 | ||||
2004-10-28 | 9:45:48 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 是关于构造函数和析构函数的 | ||||
2004-10-28 | 9:45:54 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 嗯 | ||||
2004-10-28 | 9:45:56 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 继续 | ||||
2004-10-28 | 9:46:03 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 构造函数是能有多个的吧 | ||||
2004-10-28 | 9:46:09 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 对 | ||||
2004-10-28 | 9:46:16 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 析构函数只能有一个吧 | ||||
2004-10-28 | 9:46:21 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 对 | ||||
2004-10-28 | 9:46:52 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 第二个问题结束???? | ||||
2004-10-28 | 9:47:03 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 没有,呵呵 | ||||
2004-10-28 | 9:47:30 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 我想也没这么容易:D | ||||
2004-10-28 | 9:48:02 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 析构函数是不是里面不需要定义什么东东? | ||||
2004-10-28 | 9:48:13 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 一般不需要 | ||||
2004-10-28 | 9:48:21 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 看具体应用的 | ||||
2004-10-28 | 9:48:26 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 那本"大学教程"我看完了,现在看"面向对象程序设计",里面的例子都是这样的 | ||||
2004-10-28 | 9:48:54 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 那么说,程序只要自己调用了析构函数就自动把所以对象占用的资源释放了? | ||||
2004-10-28 | 9:49:14 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 那么析构函数只是一个形式了? | ||||
2004-10-28 | 9:49:22 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 析构函数不是用来释放自身对象的 | ||||
2004-10-28 | 9:49:45 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 不是只有一个形式 | ||||
2004-10-28 | 9:49:59 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 很多情况下需要在析构函数里做一些处理的 | ||||
2004-10-28 | 9:50:21 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 是不是一般在析构函数里面加上delete object的语句 | ||||
2004-10-28 | 9:50:25 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 例如,MFC的窗口类可能会在析构函数中调用destroywindow函数,来删除窗口对象 | ||||
2004-10-28 | 9:50:30 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 不一定 | ||||
2004-10-28 | 9:51:00 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 那么定义一个类的时候,如果没有特殊需要,可以不定义析构函数了? | ||||
2004-10-28 | 9:51:03 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 如果你的类成员有一个指针,并且在类实例运行过程中new了其他对象并附给这个指针 | ||||
2004-10-28 | 9:51:07 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 嗯,对 | ||||
2004-10-28 | 9:51:28 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 如果你的类成员有一个指针,并且在类实例运行过程中new了其他对象并附给这个指针 ,那么可能需要在析构函数里delete 指针 | ||||
2004-10-28 | 9:51:38 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 那么我在析构函数中加上 delete object_self 会不会有语法错误? | ||||
2004-10-28 | 9:51:52 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 不会 | ||||
2004-10-28 | 9:51:59 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 可以delete this | ||||
2004-10-28 | 9:52:04 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 的 | ||||
2004-10-28 | 9:52:15 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 那么析构函数会把对象的资源释放吗? | ||||
2004-10-28 | 9:52:43 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | delete this?? | ||||
2004-10-28 | 9:52:43 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 对象本身的资源是delete之类的来释放的 | ||||
2004-10-28 | 9:52:55 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 具体我也没用过 | ||||
2004-10-28 | 9:53:00 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 我看过别人用 | ||||
2004-10-28 | 9:53:05 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 比较有非议 | ||||
2004-10-28 | 9:53:15 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 如果析构函数中没有任何语句,类技术的时候会自动delete object吗? | ||||
2004-10-28 | 9:53:33 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 类技术的时?? | ||||
2004-10-28 | 9:53:36 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 什么意思 | ||||
2004-10-28 | 9:53:40 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 类结束 | ||||
2004-10-28 | 9:54:17 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 析构函数跟本身类是没关系的,就算你析构函数什么都不写,你的对象也能被释放 | ||||
2004-10-28 | 9:54:38 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 那么一般只要在类体中定义一个~ClassName()就行了,里面可以不要语句? | ||||
2004-10-28 | 9:54:50 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 析构函数里用来释放那些你在类的构造或成员函数中生成过的资源 | ||||
2004-10-28 | 9:54:52 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 对 | ||||
2004-10-28 | 9:55:07 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 哦,那么编译器会自动在你类结束的时候把资源释放了,呵呵 | ||||
2004-10-28 | 9:55:55 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 难怪“面向对象程序设计”里面的析构函数的例子都是打印一句话,什么语句都没有,呵呵,原来会自动释放,我看了半天没搞懂 | ||||
2004-10-28 | 9:56:07 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 嗯 | ||||
2004-10-28 | 9:56:14 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 第二个问题结束 | ||||
2004-10-28 | 9:56:24 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | .......... | ||||
2004-10-28 | 9:56:30 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 第三个问题,有两个小问题 | ||||
2004-10-28 | 9:56:38 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 不过两个小问题都是大问题,哈哈 | ||||
2004-10-28 | 9:56:45 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 晕 | ||||
2004-10-28 | 9:56:46 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 继续 | ||||
2004-10-28 | 9:56:57 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 1。异常处理 | ||||
2004-10-28 | 9:57:02 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 2。名字空间 | ||||
2004-10-28 | 9:57:09 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 汗 | ||||
2004-10-28 | 9:57:14 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 都很少用 | ||||
2004-10-28 | 9:57:33 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 书上异常处理讲了一点,但是名字空间彻底没有 | ||||
2004-10-28 | 9:57:50 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 名字空间是为了解决类名冲突的 | ||||
2004-10-28 | 9:57:54 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 很简单 | ||||
2004-10-28 | 9:58:19 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 举例 | ||||
2004-10-28 | 9:58:50 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 例如,两个软件开发商都提供了一个能翻译的类 | ||||
2004-10-28 | 9:58:59 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 能翻译的类? | ||||
2004-10-28 | 9:59:02 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 基中一个是en 2 cn | ||||
2004-10-28 | 9:59:10 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 另一个是cn 2 en | ||||
2004-10-28 | 9:59:22 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 你的程序中需要两个功能一起用 | ||||
2004-10-28 | 9:59:44 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 但是,两个软件开发商的类都起名为CTRAN | ||||
2004-10-28 | 9:59:44 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 这时怎么办? | ||||
2004-10-28 | 10:00:06 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 你总不能帮他们其中一个手动改名的吧 | ||||
2004-10-28 | 10:00:38 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 恩 | ||||
2004-10-28 | 10:00:51 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 所以,命名空间就能休现出好处了. | ||||
2004-10-28 | 10:01:15 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 提供商A可以把他的类都放在nsA这个名字里 | ||||
2004-10-28 | 10:01:35 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 而提供商B则把他的类都放在nsB这个名字 里 | ||||
2004-10-28 | 10:01:52 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 你用的时候就可以 | ||||
2004-10-28 | 10:01:53 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | nsA::CTRAN aa; | ||||
2004-10-28 | 10:02:10 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 这时的aa表示是一个类型为提供商A的类 | ||||
2004-10-28 | 10:02:16 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | nsB::CTRAN bb; | ||||
2004-10-28 | 10:02:26 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | ::是域操作符 | ||||
2004-10-28 | 10:02:29 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | bb表示类型为提供商B的类 | ||||
2004-10-28 | 10:02:50 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 命名空间也可以算是一种域 | ||||
2004-10-28 | 10:03:19 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 那怎么把他们改名为nsA::CTRAN? | ||||
2004-10-28 | 10:03:49 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 这可能是提供商本来就提供了命名空间nsA | ||||
2004-10-28 | 10:03:50 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 如果没有 | ||||
2004-10-28 | 10:04:26 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 你可以自己用命名空间的语法在一个文件中定义,然后,include提供商的头文件 | ||||
2004-10-28 | 10:04:31 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | C++怎么描述上面的过程? | ||||
2004-10-28 | 10:04:50 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 具体怎么定义一个命名空间我没看 | ||||
2004-10-28 | 10:04:57 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 还有一个问题是 | ||||
2004-10-28 | 10:05:28 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 你现在只要用到其中一个提供商的类,并且类名绝对不会跟其他类同名冲突 | ||||
2004-10-28 | 10:05:41 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 但是,提供商却提供了命名空间 | ||||
2004-10-28 | 10:06:01 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 那么,你用他的类的时候都得前面加上命名空间:: | ||||
2004-10-28 | 10:06:08 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 这样很麻烦 | ||||
2004-10-28 | 10:06:25 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 所以,C++里有一个using namespace的语句 | ||||
2004-10-28 | 10:06:40 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 只要你在前面定义了using namespace xxx; | ||||
2004-10-28 | 10:07:00 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 那么xxx这个命名空间里的类你就可以直接用类名而无需再加上xxx:: | ||||
2004-10-28 | 10:07:50 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 哦,就是相当于你目前是在xxx这个命名空间里面了 | ||||
2004-10-28 | 10:07:57 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 嗯 | ||||
2004-10-28 | 10:07:58 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 类似 cd xxx | ||||
2004-10-28 | 10:08:10 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 差不多是这个意思 | ||||
2004-10-28 | 10:08:23 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 第二个小问题明白了 | ||||
2004-10-28 | 10:08:25 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 呵呵 | ||||
2004-10-28 | 10:08:48 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 至于异常我是从来没自己写过 | ||||
2004-10-28 | 10:09:05 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 你就用if...else? | ||||
2004-10-28 | 10:09:05 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 最多就是在用com的时候try catch之类的 | ||||
2004-10-28 | 10:09:15 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 经常 | ||||
2004-10-28 | 10:09:29 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 那你简单描述以下异常处理,我看书看的晕晕的 | ||||
2004-10-28 | 10:09:54 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 就是try{} | ||||
2004-10-28 | 10:09:59 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 大括号里的代码 | ||||
2004-10-28 | 10:10:22 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 如果这里面的代码遇到错误,会抛出一个错误, | ||||
2004-10-28 | 10:10:37 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 包括那些错误 | ||||
2004-10-28 | 10:11:10 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 错误是大括号里的那此代码自定义的 | ||||
2004-10-28 | 10:11:14 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | try{}里面的代码也是跟上面的代码一起的吗? | ||||
2004-10-28 | 10:11:32 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 对啊 | ||||
2004-10-28 | 10:12:14 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 就是把那些你认为可能会出现错误的代码段放到try里面 | ||||
2004-10-28 | 10:12:35 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 对 | ||||
2004-10-28 | 10:12:47 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 然后这些代码会按约定抛出一定错误 | ||||
2004-10-28 | 10:13:02 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 如果发生错误的话 | ||||
2004-10-28 | 10:13:10 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 约定? | ||||
2004-10-28 | 10:13:17 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 那里来的约定? | ||||
2004-10-28 | 10:13:45 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 就啊,每个函数会产生什么样的错误都是有规定的 | ||||
2004-10-28 | 10:14:10 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 就像函数的参数一样 | ||||
2004-10-28 | 10:14:11 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 用mfc里的cfile来兴例 | ||||
2004-10-28 | 10:14:13 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 举 | ||||
2004-10-28 | 10:14:38 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 恩 | ||||
2004-10-28 | 10:15:04 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | CFile( LPCTSTR lpszFileName, UINT nOpenFlags ); throw( CFileException ); | ||||
2004-10-28 | 10:15:36 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 在MSDN里面,这个函数会有什么样错误,分别会抛出什么样的异常,都会有详细说明 | ||||
2004-10-28 | 10:16:20 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 这样,你在catch中才能有目的的捕获异常 | ||||
2004-10-28 | 10:16:42 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | catch如何捕获异常? | ||||
2004-10-28 | 10:16:43 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 不然,你只能catch(...) | ||||
2004-10-28 | 10:17:07 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | catch(这里写上错误的类型) | ||||
2004-10-28 | 10:17:22 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 具体我也很少用 | ||||
2004-10-28 | 10:17:23 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 是不是类似case | ||||
2004-10-28 | 10:17:34 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 差不多有点那个意思吧 | ||||
2004-10-28 | 10:18:02 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 就是说再try里面定义好的错误类型,再catch里面有相应的处理代码 | ||||
2004-10-28 | 10:18:13 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 嗯 | ||||
2004-10-28 | 10:18:20 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 哦,有点思路了 | ||||
2004-10-28 | 10:18:27 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 你用C++举例说明一下 | ||||
2004-10-28 | 10:18:50 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 异常是比较有争议的机制 | ||||
2004-10-28 | 10:18:52 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 我抄以前的代码给你看吧 | ||||
2004-10-28 | 10:19:24 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 好 | ||||
2004-10-28 | 10:19:32 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | try { // 打开本地Access库 m_pConnection->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=bksms.dat","","",adModeUnknown); } catch(_com_error e) { AfxMessageBox("数据库连接失败,请重新安装程序!"); return FALSE; } | ||||
2004-10-28 | 10:20:04 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 至于怎么定义异常和怎么抛出异常 ,我自己没写过 | ||||
2004-10-28 | 10:20:10 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 要写的话也得翻书 | ||||
2004-10-28 | 10:20:14 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 呵呵 | ||||
2004-10-28 | 10:20:27 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 因为自己不使用异常,就一直没去看 | ||||
2004-10-28 | 10:20:47 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | catch(_com_error e) { AfxMessageBox("数据库连接失败,请重新安装程序!"); return FALSE; } | ||||
2004-10-28 | 10:21:00 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 真懒,呵呵,要是有我那种探索精神多好呀,哈哈 | ||||
2004-10-28 | 10:21:06 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 这时的e对象中有该错误的具体描述和错误号等 | ||||
2004-10-28 | 10:21:19 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 可以通过调用e.xxxx来得到 | ||||
2004-10-28 | 10:21:36 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 具体错误类有什么函数这些可以看具体的参考 | ||||
2004-10-28 | 10:22:21 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | _com_error e那里来的? | ||||
2004-10-28 | 10:22:49 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 就是m_pConnection->Open这个函数定义的可能会抛出的异常 | ||||
2004-10-28 | 10:23:13 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 哦,_com_error是一个mfc的类,然后实例化e这个对象? | ||||
2004-10-28 | 10:23:34 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 这里你可以当作是形参数 | ||||
2004-10-28 | 10:23:47 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 类还能这么用,呵呵 | ||||
2004-10-28 | 10:23:47 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 实例化是在m_pConnection->Open中遇到错误后 | ||||
2004-10-28 | 10:23:49 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 实例化的 | ||||
2004-10-28 | 10:27:10 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 我还是要好好再学习学习异常处理..... | ||||
2004-10-28 | 10:27:18 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 嗯 | ||||
2004-10-28 | 10:27:29 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 你为啥不好好看书,呵呵? | ||||
2004-10-28 | 10:27:29 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 新型的语言中都内建了异常处理机制 | ||||
2004-10-28 | 10:27:35 | 混混程序员?程序员混混?? | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 呵 | ||||
2004-10-28 | 10:27:42 | heiyeluren〖我干杯,你随意,这是个残酷的喜剧!〗(co) | 混混程序员?程序员混混?? | 对呀,连PHP5都有了 |
MSN上关于C++的异常处理和名字空间的聊天记录
最新推荐文章于 2024-04-20 10:55:59 发布