c++
Winnerong
考研中
展开
-
队列的实现C++
头文件的实现 /**queue.h文件**/ #include #include #include using namespace std; #define error -1 #define queue_size 6 #define elem_type char typedef struct queue{ unsigned int length; unsigned int tail,hea原创 2013-03-30 21:06:03 · 786 阅读 · 0 评论 -
C风格字符串和strlen
C风格字符串并不是说C语言的类型,也不能说是C++语言的类型,而是指以空字符null结束的字符数组。就比如 char c[]={'h','e','l','l','o'}; 此时字符数组中存放的是hello; 而char *s="hello"; s中存放的则是hello\0. 在使用strlen计算字符数组长度是,若如此strlen(c),则你得到值不一定是5,而strlen(s)的值一定原创 2013-03-30 20:54:42 · 560 阅读 · 0 评论 -
C++默认构造函数在需要的时候被编译器构造出来 解析
C++默认构造函数在需要的时候被编译器构造出来: 关键在:在需要的时候。而在原创 2014-09-14 21:19:41 · 689 阅读 · 0 评论 -
struct 对齐机制和sizeof 笔记
直接用例子说明吧: struct原创 2014-09-14 21:28:24 · 518 阅读 · 0 评论