![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
一灯大师_Alex
擅长各种板子点灯
展开
-
C++实例---构造函数的重载
代码:#include <iostream> #include <iomanip> #include <string>using namespace std;class point { private: double fx, fy; public: point(); point(double x, double y); void showpoint(); };poin原创 2017-02-16 14:02:55 · 912 阅读 · 0 评论 -
C++实例---虚基类的构造函数和初始化
运行环境:macOS shell 代码:#include <iostream> #include <iomanip> #include <string> using namespace std;class base { protected: int x; public: base(int x1) { x = x1; cout<<"constr原创 2017-02-17 17:11:02 · 1809 阅读 · 0 评论 -
C++实例---输出时间(类的练习)
运行环境:macOS shell代码:#include <iostream> #include <iomanip> #include <string> using namespace std;typedef char string80[80]; class Date {public: Date() {} Date(int y, int m, int d)原创 2017-02-17 17:31:40 · 637 阅读 · 0 评论 -
C++实例---常用的IO流控制符
dec: 置基数为10 hex: 置基数为16 oct: 置基数为8 setfill(c):设填充字符为c setprecision(n):设显示小数精度为n位 setw(n):设域宽为n个字符 setiosflags(ios::fixed):固定的浮点显示 setiosflags(ios::scientific):指数显示 setiosflags(ios::left):左对齐 s原创 2017-02-14 16:34:06 · 1634 阅读 · 0 评论 -
C++实例---数组访问(指针)
代码:#include <iostream> #include <iomanip> #include <string>using namespace std;int main (int argc, char **argv) { int a[3][3] = {1,2,3,4,5,6,7,8,9}; int i = 1, j = 1; int (*p)[3]; cout<原创 2017-02-15 15:52:28 · 794 阅读 · 0 评论