摘要: 类的私有属性是一个指针,构造函数用new 分配动态内存的时候,在成员函数中不能直接用这个属性进行直接的复制,那样会出现内存的混乱具体的做法是赋值的是数值而不是指针。虚:虚方法:如果在派生类中重新定义基类的方法,通常应将基类方法声明为虚的。这样,程序将根据对象类型,而不是引用或者指针的类型来选择版本。... 阅读全文
posted @ 2015-03-09 16:45 Kyle Ruan 阅读(120) 评论(0) 推荐(0) 编辑
摘要: #include const double * f1(const double ar[],int);const double * f2(const double [],int);const double * f3(const double *,int);int main(){using namesp... 阅读全文
posted @ 2015-03-09 14:18 Kyle Ruan 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 我的机子用Xcode,单位是字节0开头为8进制0x为16进制cout默认输出的是10进制wchar_t 宽字节,它是一种足够大的整形类型,可以用来表示的是比如中文的编码c常量一旦被定义,就不能被修改(const)浮点数,c++中浮点数在计算内存中由两部分组成,一部分为基数,一部分用来表示浮点,这个浮... 阅读全文
posted @ 2015-03-08 22:04 Kyle Ruan 阅读(460) 评论(0) 推荐(0) 编辑
摘要: c++primer第六版 课后编程练习的源代码,从第七章到第16章,基本全,网盘下载地址为http://pan.baidu.com/s/1ntolFKH 阅读全文
posted @ 2015-03-06 11:57 Kyle Ruan 阅读(920) 评论(0) 推荐(0) 编辑
摘要: Touches触摸事件处理:在viewcontroller中添加touch的一些方法//获取触摸点println(touches.anyObject()?.locationInView(self.view))多点触摸得在viewdidload中打开多触摸,self.view.multipleTouc... 阅读全文
posted @ 2015-02-19 16:03 Kyle Ruan 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Page-Base Application :作为一个电子书的应用模板1关于数据源,首先查看到RootViewController的ViewDidLoad方法的一个datasource来源——ModelController2ModelController方法的初始方法提供了数据的来源和显示内容Mas... 阅读全文
posted @ 2015-02-19 15:36 Kyle Ruan 阅读(156) 评论(0) 推荐(0) 编辑
摘要: IOSstoryboard做界面跳转设计页面:self.dismissViewControllerAnimated(true, completion: nil )ios8已经替换掉了老得方法定义 使用两个参数的dismissViewControllerAnimatedNIB做界面设计:self.pr... 阅读全文
posted @ 2015-02-19 13:08 Kyle Ruan 阅读(183) 评论(0) 推荐(0) 编辑
摘要: IOS tableViewControllertableViewController ---带有Controller的类都是标准的MVC模式tableView的使用:----tableViewController的子类,只有ViewtableView和他的类型:tableView控件可以通过自己写继... 阅读全文
posted @ 2015-02-19 12:22 Kyle Ruan 阅读(240) 评论(0) 推荐(0) 编辑
摘要: swift是一门脚本语言无指针和内存管理机制函数内部可以定义函数funca->(Int->Int) :一个返回函数地址的函数------这个返回的函数是一个Int参数,返回值Int的函数swift的数组是动态分配内存的------没有所谓的先定义长度,再使用闭包closure——>>反向传值———>... 阅读全文
posted @ 2015-02-19 11:36 Kyle Ruan 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 关于链表的数据成员和一般的方法template class QueueTp{private: struct Node{T item; struct Node * next;}; enum {Q_SIZE=10}; Node *front; Node *rear; int... 阅读全文
posted @ 2014-12-21 12:46 Kyle Ruan 阅读(298) 评论(0) 推荐(0) 编辑