一、什么是空指针和野指针1.空指针1> 没有存储任何内存地址的指针就称为空指针(NULL指针)2> 空指针就是被赋值为0的指针,在没有被具体初始化之前,其值为0。下面两个都是空指针:1 Student *s1 = NULL;2 3 Student *s2 = nil;2.野指针"野指针"不是NULL...
分类:
其他好文 时间:
2014-08-12 16:57:14
阅读次数:
223
table属性
table库是有一些辅助函数构成的,这些函数将table作为数组来操作。其中,有对列表中插入和删除元素的函数,有对数组元素进行排序的函数,还有对链接一个数组中所有字符串的函数。
0.table.getn()Lua 中我们经常假定 array 在最后一个非 nil 元素处结束。
这个传统的约定有一个弊端:我们的 array中不能拥有 nil 元素。对大部分应用来...
分类:
其他好文 时间:
2014-08-12 00:40:23
阅读次数:
197
[plain]view plaincopyprint?- (id)init {self = [super init]; // Call a designated initializer here.if (self != nil) {// 省略其他细节}return self;}容易让人困惑的地方在于...
分类:
其他好文 时间:
2014-08-12 00:29:23
阅读次数:
236
1.0 数据表模型(mode)func GetMyads(zoneid string) ([]orm.ParamsList, error) { tidNum, err := strconv.ParseInt(zoneid, 10, 32) if err != nil { r...
分类:
数据库 时间:
2014-08-12 00:23:33
阅读次数:
849
- (void)startLoop
{
[NSThread
detachNewThreadSelector:@selector(loopMethod)
toTarget:self
withObject:nil];
}
- (void)loopMethod
{
[NSTimer
scheduledTimerWithTimeInterval:3.0f...
分类:
移动开发 时间:
2014-08-11 21:31:22
阅读次数:
211
UIAlertView使用
基本用法
// 创建一个UIAlertView并显示出来
UIAlertView *alertview = [[UIAlertView alloc] initWithTitle:aTitle message:msg delegate:nil cancelButtonTitle:str otherButtonTitles:nil];
[alertview show];...
分类:
其他好文 时间:
2014-08-11 10:07:51
阅读次数:
202
- (NSString *)getCarrier { NSString *strCarrier = nil; CTTelephonyNetworkInfo *networkInfo = [[CTTelephonyNetworkInfo alloc] init]; CT...
分类:
其他好文 时间:
2014-08-11 00:09:31
阅读次数:
294
GameHwnd:= FindWindow(nil,'对对碰角色版');//得到进程IDGetWindowThreadProcessId(GameHwnd,GamePid);//得到进程句柄GameProcess:= OpenProcess(PROCESS_VM_READ or PROCESS_VM...
分类:
其他好文 时间:
2014-08-09 15:32:18
阅读次数:
238
lua中文件读写经常在游戏配置中用到,比如客户端的音效音乐开关等。
Lua官方API文档:点这里
I/O库为文件操作提供4个主要函数:io.open(),io.read(),io.write和io.close()。
io.open(文件路径,打开方式):以指定方式打开一个文件,打开成功返回一个文件句柄,失败返回nil和错误描述。
可以传入以下六种打开方式:...
分类:
其他好文 时间:
2014-08-09 11:42:44
阅读次数:
256
#lang scheme
( define l ( list 1 2 3 4 ) )
( define l1 ( list 5 6 7 8 ) )
( define nil '() )
( define ( make-leaf symbol weight )
( list 'leaf symbol weight ) )
( define ( l...
分类:
其他好文 时间:
2014-08-09 02:39:06
阅读次数:
236