码迷,mamicode.com
首页 >  
搜索关键字:const 底层const 顶层const    ( 26295个结果
iOS客户端流量统计
自己统计流量的话 需要判断是3G访问还是WIFI访问用 NSURLProtocol自定义一个这个累计DATA就是下行流量#include #include #include #include BOOL success; struct ifaddrs *addrs; const struc...
分类:移动开发   时间:2014-06-18 20:51:23    阅读次数:323
iOS学习笔记---c语言学习第七天
结构体结构体是一种自定义的数据类型struct 结构体名{ 类型说明符 成员名; … 类型说明符 成员名;};#import int main(int argc, const char * argv[]){ struct teacher{ char name[30]; ...
分类:移动开发   时间:2014-06-18 19:42:08    阅读次数:413
Enumeration & Class & Structure
【Enumeration】1、当一个枚举值类型已经确定后,可以使用shorter dot syntax来赋予其它值: 2、对一个枚举值switch的时候也可以使用short dot syntax: 3、Associate Value 定义: 上面extract的值均为const,把...
分类:其他好文   时间:2014-06-18 19:01:55    阅读次数:206
HYSBZ 1008
数学题,推出公式就好了!//Accepted 804 KB 0 ms#include #include const long long pp = 100003;long long pow(long long a,long long b){ if (b==0) return 1; ...
分类:其他好文   时间:2014-06-18 18:20:41    阅读次数:163
最大子序列和
动态规划的算法:#includeint MaxSubsequenceSum(const int A[],int n){ int i,sum,MaxSum; sum=MaxSum=0; for(i=0;iMaxSum) MaxSum=sum; if...
分类:其他好文   时间:2014-06-18 17:56:31    阅读次数:139
写文件的流程
许多文件系统都是通过generic_file_write()函数来实现文件对象的write方法,即write(库函数)->sys_write()->generic_file_write(): ssize_t generic_file_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)...
分类:其他好文   时间:2014-06-16 22:47:52    阅读次数:203
POJ 1789-Truck History
题目链接:Truck History 题意就是N个卡车的型号,一代一代的发展,两辆卡车的型号中 不同字母的个数代表着两辆卡车的距离,确定一个点,遍历到所有的点,使之这个距离最小。 很明显最小生成树,稠密图,1次AC,水过 #include #include #include #include #include const int N = 2001; cons...
分类:其他好文   时间:2014-06-16 21:51:25    阅读次数:259
常量指针和指针常量的区别
一,常量指针,顾名思义,就是指向常量的指针,指针指向的内容不能改变,但是地址可以改变;声明方式:const类型*指针常量名=&变量名;如:constintk=5,t=8;constint*p=&k;*p=9;//指向的是常量,不可以赋值p=&s;//可以指向其他地址二,指针常量,即指针本身是个常量..
分类:其他好文   时间:2014-06-16 15:23:09    阅读次数:164
Effective C++:条款20:宁以 pass-by-reference-to-const替换pass-by-value
(一) 调用函数的时候如果传递参数pass-by-value,那么函数参数都是以实际实参的副本为初值,调用端所获得的亦是函数返回值的一个复件。 看下面代码: class Person { public: Person(); virtual ~Person(); private: string name; string address; }; ...
分类:编程语言   时间:2014-06-16 14:57:30    阅读次数:184
线程间的参数传递
在多线程编程中,常常需要从主线程传递参数给子线程或在主线程中获得子线程的计算结果, 若使用全局变量实现,必然需要对临界区保护,因此导致大量的切换工作造成效率的低下; 而利用进程间的参数传递可以解决这一问题。 两个方向的参数传递: 1.主线程向子线程传递参数: 通过函数 int pthread_create(pthread_t *thread, const pthread_attr_t *...
分类:编程语言   时间:2014-06-16 14:34:54    阅读次数:242
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!