最近在搜索类似scope
exit的实现时,除了发现已经有人向标准委员会提出意见,还得到一些意外的C++特性,这个特性一直都存在,而且很有趣http://herbsutter.com/2008/01/01/gotw-88-a-candidate-for-the-most-important-cons...
分类:
编程语言 时间:
2014-05-12 13:21:19
阅读次数:
414
当类中用到一些固定值时,希望将其定义为const成员变量,防止被修改。但因为const成员变量因为初始化之后就不能修改,因此只能在构造函数的初始化列表中初始化如果是数组,则没有办法在初始化列表中初始化,必须定义为static,放在类外定义例子://const_array.h#include
usin...
分类:
其他好文 时间:
2014-05-12 12:16:52
阅读次数:
228
1.Object-C也是面向对象的语言;2.#include
//#include是一个预处理指令3.using namespace std;
//std是命名空间,using决定了该源程序中的代码可以不用指定命名空间名为std4.const
常量只能读,不能修改,并且定义时必须初始化;5.由低精度...
分类:
编程语言 时间:
2014-05-12 09:07:01
阅读次数:
365
1.BCB 菜单:
Project->Options->Packages->Add[喝小酒的网摘]http://blog.const.net.cn/a/8496.htm如果是BCB6:
选择安装的文件夹 yb_base_c6.bpl 和 yb_comm_c6.bpl, 然后按“打开”按钮如果是BCB...
分类:
其他好文 时间:
2014-05-12 08:32:09
阅读次数:
470
首先是CDQ《基于连通性状态压缩的动态规划问题》论文上的题目:URAL 1519
Formula 1 #include 2 #include 3 #include 4 using namespace std; 5 const int maxn
= 15; 6 const int H...
分类:
其他好文 时间:
2014-05-12 08:14:39
阅读次数:
433
C++异常:no matching function for call to
"Matrix(Matrix&)"我定义了一个类叫Matrix,其中构造函数explicit Matrix(const Matrix&
source);也写了一个方法:Matrix Matrix::myFun(const ...
分类:
编程语言 时间:
2014-05-10 07:16:04
阅读次数:
363
//#include
#include
#include
//using namespace std;
//const int MAXN=10;
//int Stack[MAXN];
stack s;
class Solution {
public:
int getNumber(int x)
{
//int lengthOfStack=0;...
分类:
其他好文 时间:
2014-05-10 04:45:29
阅读次数:
231
1. fopen函数1 #include 2 FILE *fopen(const char
*path, const char *mode) 返回:文件顺利打开后,指向该流的文件就会被返回。如何文件打开失败则返回NULL,并把错误代码存在 errno
中。参数说明: mode: 1)r 以只读方式....
分类:
其他好文 时间:
2014-05-10 03:00:13
阅读次数:
290
#includeusing namespace std;const int maxn =
30000+100;int F[maxn], D[maxn], S[maxn];void set(int n){ for(int i =0 ;i
>P; char c; int a, b; while(P--)...
分类:
其他好文 时间:
2014-05-10 02:56:28
阅读次数:
313