C/C++
大玥玥
这个作者很懒,什么都没留下…
展开
-
Complex类的实现过程
Complex.h#ifndef _COMPLEX_#define _COMPLEX_ //防卫式声明#include <iostream>using namespace std;class complex{public: complex(double r = 0, double i = 0):re(r), im(i) { } //构造函数初始化,形参无论pass by value原创 2017-05-30 21:02:16 · 720 阅读 · 0 评论 -
String类的实现过程
String.h#ifndef _MYSTRING_#define _MYSTRING_#include <iostream>using namespace std;class String{public: String(const char* cstr = 0); //class with a pointer member,big three String(con原创 2017-05-31 15:44:40 · 277 阅读 · 0 评论 -
可变参数函数的实现
C语言中可变参数函数,printf如何实现的#include <stdarg.h>-va_list-va_start-va_arg-va_endva的意思就是variable-argument,例子演示比较好理解#include <stdio.h>#include <stdarg.h>int sum(int n, ...);int sum(int n, ...){ int i,原创 2016-12-06 16:19:31 · 237 阅读 · 0 评论