模板 下面是一个针对int的冒泡排序
// _20180301.cpp : Defines the entry point for the console application. // #include "stdafx.h" void Sort(int* arr,int nLength) { int i,k; for (i = 0;ix > base.x …
什么是继承 struct Person { int age; int sex; }; struct Teacher { int age; int sex; int level; int classId; }; struct Teacher:Person { int level; int classId; }; 总结:
1、什么是继承?
继承就是数据的复制 …
封装 C语言和C++语言的区别 C++是对C的补充扩展,C原有的语法C++都支持,并在此基础上扩展了一些新的语法:
继承、封装、多态、模板等等
结构体可以作为参数传递吗 struct Student { int a; int b; int c; int d; } //分析这个函数是如何传递参数的 int Plus(student s) { return …