UNIX之父:Dennis Ritchie(Dennis MacAlistair Ritchie 丹尼斯·麦卡利斯泰尔·里奇)
C语言之父:Dennis Ritchie(Dennis MacAlistair Ritchie 丹尼斯·麦卡利斯泰尔·里奇)
Linux之父:Linus Benedict[……]
Monthly Archives: December 2018
Leave a reply
第一个MFC程序
1、Application.h
#pragma once
#include <afxwin.h>
class Application : public CWinApp
{
public:
BOOL InitInstance();
};
[……]
C++智能指针auto_ptr,简单实现
实现数组类Array,函数模板的简单应用
自定义字符串类String,实现运算符重载,内存管理
1、String.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #pragma once #include <iostream> using namespace std; class String { friend ostream &operator << (ostream &, String &); private: char *m_name = NULL; char *setM_name(const char *cstring); char *strAppend(const char *, const char *); public: String(const char *cstring = ""); String(const String &); ~String(); bool operator == (String &string); String &operator = (String &string); String &operator = (const char *cstring); String operator + (const char *cstring); String operator + (const String &string); String &operator += (const char *cstring); String &operator += (const String &string); char operator[](int index); bool operator<(const String &string); }; ostream &operator << (ostream &cout, String &string); </iostream> |
2、String.cpp
[……]