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

随笔 - 305  文章 - 1  评论 - 50  阅读 - 168万
07 2015 档案
do break的妙用
摘要:#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 思齐_ 阅读(459) 评论(0) 推荐(0) 编辑
交换两个变量的不同实现方式
摘要:#include #define SWAP1(a,b) \{ \ int temp = a; \ a = b; \ b = temp; \}#define SWAP2(a,b) \{ \... 阅读全文
posted @ 2015-07-19 16:25 思齐_ 阅读(354) 评论(0) 推荐(0) 编辑
C语言柔性数组
摘要:柔性数组:数组大小待定的数组。C语言中结构体最后一个元素可以是大小未知的数组。C语言可以由结构体产生柔性数组柔性数组的结构如何只能堆上生成柔性数组是C99的扩展,简而言之就是一个在struct结构里的标识占位符(不占结构struct的空间)。#include #include typedef str... 阅读全文
posted @ 2015-07-19 11:14 思齐_ 阅读(1862) 评论(0) 推荐(0) 编辑
字节对齐
摘要:为什么需要字节对齐?计算机组成原理教导我们这样有助于加快计算机的取数速度,否则就得多花指令周期了。为此,编译器默认会对结构体进行处理(实际上其它地方的数据变量也是如此),让宽度为2的基本数据类型(short等)都位于能被2整除的地址上,让宽度为4的基本数据类型(int等)都位于能被4整除的地址上,以... 阅读全文
posted @ 2015-07-18 23:23 思齐_ 阅读(845) 评论(0) 推荐(0) 编辑
C语言sizeof
摘要:一、关于sizeof1.它是C的关键字、是一个运算符,不是函数;2.一般用法为sizeof 变量或sizeof(数据类型);后边这种写法会让人误认为是函数,但这种写法是为了防止和C中类型修饰符(static、const、extern等)冲突。二、demo1.源码test.c#include int ... 阅读全文
posted @ 2015-07-16 23:43 思齐_ 阅读(449) 评论(0) 推荐(0) 编辑
c++学习-特殊类成员
摘要:静态变量:#include#include#include using namespace std;class A{public: A(){ total++; } static int total;};//@warn 静态成员变量必须在全局进行定义int A::total =... 阅读全文
posted @ 2015-07-12 17:48 思齐_ 阅读(393) 评论(0) 推荐(0) 编辑
c++学习-多态性
摘要:强制转换父类对象为子类#include#include#include using namespace std;class father{public: void smart(){} virtual ~father(){}};class son : public father{pub... 阅读全文
posted @ 2015-07-04 22:34 思齐_ 阅读(282) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示