
C++基础
Datura_Metel
这个作者很懒,什么都没留下…
展开
-
认识C++ (1)
字符集 用编写程序时,除字符型数据外,其他成分都只能由字符集中的字符构成。 字符集由下列字符构成: 英文字母:A~Z, a~z 数字字符:0~9 特殊字符:! # % ^ & * _ + = - ~ < > / \ ' " ; . , : ? ( ) [ ] ...原创 2018-03-30 22:38:15 · 366 阅读 · 0 评论 -
bitset和字符数组的转换
#include <iostream>#include <bitset>#include <algorithm>#include <fstream>using namespace std;//c为字符串的首地址,n为字符串长度void prt(char * c, int n){ bitset<40> bitset4; int ...原创 2018-05-08 13:13:52 · 2668 阅读 · 0 评论 -
运算符重载
复数类的实现以及加号和减号的重载#include <iostream>using namespace std;//复数类定义class Complex{private: double real; double imag;public: Complex(double r = 0.0, double i = 0.0) :real(r), imag(i) {} //运算...原创 2018-06-12 20:05:50 · 258 阅读 · 0 评论