C语言 c++ php mysql nginx linux lnmp lamp lanmp memcache redis 面试 笔记 ppt 设计模式 问题 远程连接

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 31 下一页
  2015年7月20日
摘要: #include #include int func(int n){ //资源的统一申请 int i = 0; int ret = 0; int* p = (int*)malloc(sizeof(int) * n); do { if( NULL ... 阅读全文
posted @ 2015-07-20 22:32 思齐_ 阅读(447) 评论(0) 推荐(0) 编辑
  2015年7月19日
摘要: #include #define SWAP1(a,b) \{ \ int temp = a; \ a = b; \ b = temp; \}#define SWAP2(a,b) \{ \... 阅读全文
posted @ 2015-07-19 16:25 思齐_ 阅读(352) 评论(0) 推荐(0) 编辑
摘要: 柔性数组:数组大小待定的数组。C语言中结构体最后一个元素可以是大小未知的数组。C语言可以由结构体产生柔性数组柔性数组的结构如何只能堆上生成柔性数组是C99的扩展,简而言之就是一个在struct结构里的标识占位符(不占结构struct的空间)。#include #include typedef str... 阅读全文
posted @ 2015-07-19 11:14 思齐_ 阅读(1852) 评论(0) 推荐(0) 编辑
  2015年7月18日
摘要: 为什么需要字节对齐?计算机组成原理教导我们这样有助于加快计算机的取数速度,否则就得多花指令周期了。为此,编译器默认会对结构体进行处理(实际上其它地方的数据变量也是如此),让宽度为2的基本数据类型(short等)都位于能被2整除的地址上,让宽度为4的基本数据类型(int等)都位于能被4整除的地址上,以... 阅读全文
posted @ 2015-07-18 23:23 思齐_ 阅读(841) 评论(0) 推荐(0) 编辑
  2015年7月16日
摘要: 一、关于sizeof1.它是C的关键字、是一个运算符,不是函数;2.一般用法为sizeof 变量或sizeof(数据类型);后边这种写法会让人误认为是函数,但这种写法是为了防止和C中类型修饰符(static、const、extern等)冲突。二、demo1.源码test.c#include int ... 阅读全文
posted @ 2015-07-16 23:43 思齐_ 阅读(436) 评论(0) 推荐(0) 编辑
  2015年7月12日
摘要: 静态变量:#include#include#include using namespace std;class A{public: A(){ total++; } static int total;};//@warn 静态成员变量必须在全局进行定义int A::total =... 阅读全文
posted @ 2015-07-12 17:48 思齐_ 阅读(390) 评论(0) 推荐(0) 编辑
  2015年7月4日
摘要: 强制转换父类对象为子类#include#include#include using namespace std;class father{public: void smart(){} virtual ~father(){}};class son : public father{pub... 阅读全文
posted @ 2015-07-04 22:34 思齐_ 阅读(277) 评论(0) 推荐(0) 编辑
  2015年6月28日
摘要: 静态链表:#include#includeusing namespace std;struct book{ int num; float price; struct book *next;};int main(){ book x, y, z, *head, *p; x ... 阅读全文
posted @ 2015-06-28 12:55 思齐_ 阅读(249) 评论(0) 推荐(0) 编辑
  2015年6月27日
摘要: 字符数组和 string类型比较的区别#include#includeusing namespace std;class area{public: area(){ cout i = i; cout w = w; this->h = h; cout w = w; this->h =... 阅读全文
posted @ 2015-06-27 14:57 思齐_ 阅读(468) 评论(0) 推荐(0) 编辑
  2015年6月21日
摘要: int a[10]; //是个元素,在windows下回报错,linux会输出一个随机数int a[10]={1,2}; //初始化,其他的为0数组越界:为了调高效率, 编译器不会对数组越界做检查#include using namespace std;int main(){ int ... 阅读全文
posted @ 2015-06-21 23:07 思齐_ 阅读(460) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 31 下一页