lua实现面向对象lua实现面向对象
实现类的定义
实现类的继承实现类的定义function people( name) local self = {} local function init( ... )
self.name=name
end self.sayHi=function ( ... )
print("hello"..sel...
分类:
其他好文 时间:
2015-05-12 18:57:14
阅读次数:
137
Sample InputSTARTfrom fiwohello difhmars riwosfearth fnnvklike fiiwjENDSTARTdifh, i'm fiwo riwosf.i fiiwj fnnvk!END Sample Outputhello, i'm from mars....
分类:
其他好文 时间:
2015-05-12 18:39:47
阅读次数:
110
关于cin缓存的清空,网上有各种说法。最多的是使用
cin.sync();
但是,关于这个sync方法在不同的编译器中有不同的实现。VC中确实可以清空cin的缓存,但是在GNU中,不行。因此使用sync方法是没有通用性的。又有说法是使用
cin.seekg(0, ios_base::end);
但是依旧无法正常工作。以下是一个测试代码...
分类:
其他好文 时间:
2015-05-12 17:13:19
阅读次数:
241
以下是全部源码,感兴趣的朋友可以整个窗口的源代码导入到PBL里自己运行一下试试。PBExportHeaderPBExportHeaderw_button.srw
forward
global type w_button from window
end type
type cb_11 from commandbutton within w_button
end type
type cb_1...
分类:
其他好文 时间:
2015-05-12 13:36:29
阅读次数:
175
c语言中用可变参数列表的原因cpp文件中参数可以初始化,则实参中用几个参数写几个,但是c中形参不可以初始化,所以引出可变参数列表,头文件为stdarg.h,使用宏stdarg
va_list类型 arg变量 eg:va_list arg
宏stdarg使用了三种宏
va_start(arg,val)初始化
va_arg(arg,int)读取
va_end(arg)结束...
分类:
其他好文 时间:
2015-05-12 13:36:08
阅读次数:
136
#import @interface Student : NSObject{ int _age; char *_name;}- (void) study;- (void) run;+ (void) play;+ (void) run;@end@implementation Student...
分类:
其他好文 时间:
2015-05-12 13:28:41
阅读次数:
115
【题目】
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of nodes is not a multiple of k then left-out nodes in the end should remai...
分类:
其他好文 时间:
2015-05-12 11:34:01
阅读次数:
92
#import "AppDelegate.h"#import "ViewController.h"@interface AppDelegate ()@end@implementation AppDelegate- (BOOL)application:(UIApplication *)applicat...
分类:
其他好文 时间:
2015-05-12 10:53:00
阅读次数:
112
C函数要在程序中用到以下这些宏:
void va_start( va_list arg_ptr, prev_param );
type va_arg( va_list arg_ptr, type );
void va_end( va_list arg_ptr );
va_list:用来保存宏va_start、va_arg和va_end所需信息的一种类型。为了访问变长参...
分类:
编程语言 时间:
2015-05-12 09:27:33
阅读次数:
133
说明:这里只介绍基本测试逻辑整理出整个APP需要关注的一级页面列表基本工具:ut(内部工具,不便透露细节)在开发代码中引入TimeProfile类:这个类是ut的最上层,暴露出一些简单的时间打点方法,start(),end()等方法;在整理出来的一级页面对应的代码中,主要是指activity类中,..
分类:
移动开发 时间:
2015-05-12 01:45:28
阅读次数:
4527