- 博客(6)
- 收藏
- 关注
原创 C++ 位域操作 置0置1
bitset bp; unsigned char up = 0; cout << bp << endl; cout << (unsigned)up << endl; bp.set(3); up = up | (1UL<<3); cout << bp << endl; cout << (unsigned)up << endl; bp.reset(3); up = up &
2015-02-06 15:47:53 1112
原创 C++ string to char *
string s = "yangshaofei";const char *p = s.c_str();
2015-02-06 14:47:09 3715
原创 C++ biteset
#include #include using namespace std;int main(){ bitset b1; bitset b2("00001111");//不能用非0\1字符初始化或赋值 bitset b3(0xff); bitset b4(0xff); if (b2.any())//has 1 bit ? { cout << "b2 has 1 i
2015-02-05 15:55:21 1348
原创 C++ vector
#include #include #include using namespace std;int main(){ string word; vector v1; //while (cin >> word) //{ // v1.push_back(word); //} for (vector::size_type ix = 0; ix != 10; ++ix)
2015-02-05 14:21:08 465
原创 VS2010 C++变量初始化global local
C++ Primer中文第四版习题#include #include using namespace std;string global_str;int global_int;int main(){ string local_str; int local_int; cout << global_str << endl; cout << global_int << e
2015-02-04 11:59:54 1543
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人