- 博客(12)
- 问答 (2)
- 收藏
- 关注
原创 C++解析和初始化
#include #include using namespace std;/*1、父类的属性,应该有父类的构造函数去初始化2子类新增加的属性,应该有子类的构造函数完成; ==父子分工,很明确 *///在子类对象构造的时,需要调用父类构造函数对其继承得来的成员进行初始化//在子类对象析构的时,需要调用父类析构函数对其继承得来的成员进行清理class object{ p
2015-06-10 21:38:19
316
原创 C++操作符重载
#include"iostream"using namespace std;class Number{ public: Number(int a ,int b) { this->a = a; this->b = b; } Number operator+(Number& n) { this->a = this->a + n.a; this->b
2015-06-08 21:56:39
313
转载 C++拷贝构造函数详解
一. 什么是拷贝构造函数首先对于普通类型的对象来说,它们之间的复制是很简单的,例如:[c-sharp] view plaincopyprint?int a = 100; int b = a; int a = 100;int b = a; 而类对象与普通对象不同,类对象内部结构一般较为复杂,存在各种成员变量。下面看一个类对象拷贝的简单
2015-06-04 21:49:32
471
转载 详解Linux内核之双向循环链表
详解Linux内核之双向循环链表本文详解了内核中面向对象的list结构的原理,以及如何以list为内嵌对象来构造自己的链表结构,如何从内嵌list对象获得自定义的对象指针;探讨了各种宏或者函数的详细使用方法及怎样以通用list结构来操作自定义对象。【关键字】双向循环链表,list,list_entry,typeof,containerof,list_for_each,list_for_ea
2015-05-27 14:57:40
505
原创 C复杂链表
#include"string.h"#include"stdio.h"#include"stdlib.h"typedef struct _ListElmt{ void * data; struct _ListElmt *next;}ListElmt;typedef struct _List{ int size; int (*match)(const void* key1,c
2015-05-24 21:10:58
351
原创 C简单链表复习
#include"stdio.h"#include"stdlib.h"#include"string.h"typedef struct _ListNode{ int data; struct _ListNode * node;}ListNode;ListNode * initList(){ ListNode * li =(ListNode*)malloc(sizeof(List
2015-05-22 13:27:31
290
原创 文件复习1
#include"stdio.h"#include"stdlib.h"#include"string.h"int main(){ char path[] = "d:/2.text"; FILE *pf = fopen(path, "r+"); if(pf == NULL) { printf("error;"); return -1; } while(!feof(p
2015-05-14 15:00:23
265
原创 字符串查抄复习
#include"stdio.h"#include"string.h"#include"stdlib.h"int getsubnum1(char *ch, char *sub,int * num){ int tem = 0; char * f = ch; do { f = strstr(f,sub); if(f != NULL) { f = f + strlen
2015-05-13 16:04:07
295
原创 结构体二级指针
#include"stdio.h"#include"string.h"#include"stdlib.h" typedef struct _Teacher { char title[30]; char* btitle; char ** student; int age; }Teacher;int printfTeachers(Teacher * t, int num
2015-05-13 12:53:34
936
原创 结构体复习
#include"stdio.h"#include"string.h"#include"stdlib.h" typedef struct _Teacher { char title[30]; int age; }Teacher;int printfTeachers(Teacher * t, int num){ for(int i = 0 ;i < num ;i++)
2015-05-12 10:33:01
358
原创 C数组地址和数组名区别
#include"stdio.h"#include"stdlib.h"#include"string.h"int main(){int a[5] = {2,3,4,6,8};int b[4][5];for(int i = 0; i< 4; i++) { for(int j = 0 ;j < 5 ;j++) { b[i][j] = i+j; printf("%d",b[i][j]); } print
2015-05-08 12:34:45
296
原创 C三级指针复习
#include"stdio.h"#include"string.h"#include"stdlib.h"int saveslip(char *str ,char ***st, char c ,int *len ){ char *p ,*q; p = str; q = str; int i = 0; int count;
2015-05-08 10:51:03
402
空空如也
大神求指导简单C语言问题 刚刚入门
2015-06-29
关于C语言链表的一些问题,代码怎么都运行不成功跪求大神指点
2015-06-28
TA创建的收藏夹 TA关注的收藏夹
TA关注的人