protocal协议category 类别extension 扩展block^(传入参数列){行为主体};如果没有参数则为:^(void){行为主体}Block Pointer是这样定义的:回传值(^名字)(参数列);先看一个比较简单的Block例子:intmultiplier=7;int(^myB...
分类:
移动开发 时间:
2014-09-21 14:52:30
阅读次数:
214
Implement strStr().Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.难度:60.这是算法中比较经典的问题,判断一个字...
分类:
其他好文 时间:
2014-09-20 14:02:47
阅读次数:
292
const char * cp;cp
is a pointer to const char;cp是一个指针变量,指向一个常量字符创,注意cp是指针变量,指向const char,那么意味着cp可以指向其他的const char;但需要注意的是cp指向的是const char,所以不能通过cp来修改const char;cp可以指向其他其他的const char和通过cp来修改const cha...
分类:
其他好文 时间:
2014-09-20 08:53:07
阅读次数:
188
摘要: 本文给出IAR设置堆栈合理大小的详细方法,并分享一些好博文(icf及map讲解)。 最近在MSP430-169LCD(MSP430F169,RAM为2KB)调试一些ucos演示例子,IAR for MSP430默认的堆栈大小是80字节,编译可以通过,运行结果不确定性,调试过程会提示"the ...
分类:
其他好文 时间:
2014-09-19 15:24:55
阅读次数:
205
.Coupon{ color:@Gray; h5{ color:@DimGray;} li{ position:relative;margin:0;font-size:12px; line-height:22px;cursor:pointer; &:hover .coupont_layer{disp...
分类:
Web程序 时间:
2014-09-18 18:05:34
阅读次数:
175
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy ...
分类:
其他好文 时间:
2014-09-18 04:21:33
阅读次数:
228
同类型结构体之间赋值不一定有效
今天为这个问题debug好久...
之前看到一个关于结构体使用的技巧, 这个技巧能够避免内存零碎. 保证结构体所属内存尽量不要零散化.
struct struct_name
{
element_type varible;
...;
element_type pointer[0];
}
关于该用法的介...
分类:
其他好文 时间:
2014-09-17 23:20:32
阅读次数:
238
K&R第五章介绍了用函数指针实现的快速排序算法,对其中的代码比较困惑,所以看了下《算法导论》上对快排的介绍,下面这张图说明了快排的原理及过程:
用C实现上面的过程:
#include
/* declare function pointer */
typedef int(*fp_operation)(int a, int b);
void swap(int *a, int...
分类:
其他好文 时间:
2014-09-17 21:58:12
阅读次数:
320
DeleteRecord implicitly moves the record pointer to the next record in the record set. If a call to NextRecord is made after a call to DeleteRecord th...
分类:
其他好文 时间:
2014-09-17 18:14:22
阅读次数:
187
当类中有指针成员时,一般有两种方式来管理指针成员:一是采用值型的方式管理,每个类对象都保留一份指针指向的对象的拷贝;另一种更优雅的方式是使用智能指针,从而实现指针指向的对象的共享。 智能指针(smart pointer)的一种通用实现技术是使用引用计数(reference count)。智能指针类将...
分类:
其他好文 时间:
2014-09-17 11:47:22
阅读次数:
190