最近在搜索类似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
题意:求在两边人数不相差超过1个的情况下,实力尽量相等的情况
思路:从实力和的一半开始类背包操作
#include
#include
#include
#include
using namespace std;
const int MAXN = 45010;
const int MAXM = 110;
int a[MAXM];
int dp[MAXN][MAXM];
int n;
...
分类:
其他好文 时间:
2014-05-11 05:02:03
阅读次数:
279
1. const char* 和string 转换(1) const char*转换为
string,直接赋值即可。 EX: const char* tmp = "tsinghua". string s = tmp;(2)
string转换为const char*,利用c_str() ...
分类:
其他好文 时间:
2014-05-11 00:51:23
阅读次数:
284
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