文章目录1. struct2. map3. slice传值4. 字符串遍历5. 多返回值6. 函数类型7. Goroutine8. slice9. Defer,panic10. MD511. Http12. Interface13. Json14. Channel15. Channel16. select17. iota18. math19. random20. 不定长参数21. closure22. nil23. strings24. flag25. 继承26. 多态27. File IO28. OS29
原创
2021-12-14 10:00:27
86阅读
贺老师的教学链接 本课讲解内幕: 每个对象有个自己的this指针#include using namespace std;class Time{public: void set_time(int,int,int); void show_time();private: int hour; int minute; int sec;};int ma
原创
2022-03-17 18:37:31
58阅读
贺老师的教学链接 本课讲解内幕: 每个对象有个自己的this指针#include using namespace std;class Time{public: void set_time(int,int,int); void show_time();private: int hour; int minute; int sec;};int ma
原创
2021-05-26 10:17:31
110阅读
API函数任务创建xTaskCreate()函数原型(tasks.c中):BaseType_txTaskCreate(TaskFunction_tpxTaskCode,constchar*constpcName,constuint16_tusStackDepth,void*constpvParameters,UBaseType_tuxPriority,TaskHandle_t*constpxCre
原创
2021-02-27 22:15:56
325阅读
贺老师的教学链接重载函数:同名同体,但接口不同#include <iostream>using namespace std;int max(int a,int b,int c); //函数声明double max(double a,double b,double c); long max(long a,long b,long c); int main( ){
原创
2021-05-26 10:14:08
119阅读
贺老师的教学链接 本课讲解多重继承实例:研究生承担教学任务#includeusing namespace std;class Teacher{public: Teacher(string nam,int a, string t); void display_t( );protected: string name; int age; string
原创
2021-05-26 10:16:07
98阅读
贺老师的教学链接 本课讲解类模板的使用——参数化类#include using namespace std;templateclass Compare{public: Compare(numtype a,numtype b) { x=a; y=b; } numtype max( ) { return
原创
2021-05-26 10:17:18
38阅读
贺老师的教学链接 本课讲解对象数组应用实例#include using namespace std;class Box{public: Box(int h=10,int w=12,int len=15): height(h),width(w),length(len) { } int volume( );private: int height; int w
原创
2021-05-26 10:17:34
132阅读
贺老师的教学链接重载函数:同名同体,但接口不同#include <iostream>using namespace std;int max(int a,int b,int c); //函数声明double max(double a,double b,double c); long max(long a,long b,long c); int main( ){
原创
2022-03-17 15:34:52
96阅读
贺老师的教学链接 本课讲解问题的提出现状:n个同类的对象,每一个对象都分别有自己的数据成员,各自有值,互不相干。期望:希望有某一个或几个数据成员为某类所有对象所共有,以实现数据共享。方案:用全局变量#includeusing namespac
原创
2022-03-17 18:11:46
50阅读
贺老师的教学链接 本课讲解示例:使用指向对象数据成员的指针#include using namespace std;class Time{public: Time(int,int,int); void get_time( );private: int hour,minute,sec;};Time::Time(int h,int m,int s):hour(h
原创
2022-03-17 18:38:40
51阅读
nt height; int w
原创
2022-03-21 16:23:08
52阅读
API函数任务创建 xTaskCreate()函数原型(tasks.c中):BaseType_t xTaskCreate( TaskFunction_t pxTaskCode, const char * const pcName, const uint16_t usStackDepth, void * const pvParameters,
原创
2021-06-15 10:36:40
436阅读
贺老师的教学链接 本课讲解指向基类的指针,为何只能访问来自基类成员?!#include #include using namespace std;//声明基类Studentclass Student{public: Student(int, string,float);//声明构造函数 void display( );
原创
2022-03-17 16:40:55
95阅读
贺老师的教学链接 本课讲解类模板的使用——参数化类#include using namespace std;templateclass Compare{public: Compare(numtype a,numtype b) { x=a; y=b; } numtype max( ) { return
原创
2022-03-17 18:11:20
59阅读
贺老师的教学链接 本课讲解普通的友元函数#include using namespace std;class Time{public: Time(int,int,int); friend void display(Time &);private: int hour; int minute; int sec;};Time::Time(int
原创
2022-03-17 18:31:21
73阅读
贺老师的教学链接 本课讲解vector容器类示例#include #include using namespace std;int main(){ int a[] = {2,3,4}; vector v1; vector::iterator iter; //插入元素 v1.insert(v1.begin(),1,1); v1.insert(
原创
2021-05-26 10:14:42
65阅读
贺老师的教学链接 本课讲解浅复制#include using namespace std;class Test{private: int x;public: Test(int n) {x=n; } Test(const Test& c){x=c.x; } void show (){cout<<x<<endl;}};int main(){
原创
2021-05-26 10:17:20
114阅读
贺老师的教学链接 本课讲解示例:使用指向对象数据成员的指针#include using namespace std;class Time{public: Time(int,int,int); void get_time( );private: int hour,minute,sec;};Time::Time(int h,int m,int s):hour(h
原创
2021-05-26 10:17:33
119阅读
贺老师的教学链接 本课讲解用构造函数初始化对象#include using namespace std;class Time{public: Time( ) { hour=0; minute=0; sec=0; } void set_time( ); void show_time( );privat
原创
2021-05-26 10:18:02
102阅读