码迷,mamicode.com
首页 >  
搜索关键字:sizeof    ( 5917个结果
深入理解 字符串 和 数组
字符串与数组区别众多,现对主要的区分难点在以下几个方面:1.内存空间的分配;2.初始化的含义;3.赋值的方式;4.输入输出方式;5.地址操作,五个方面。...
分类:编程语言   时间:2015-06-11 19:31:08    阅读次数:129
[[NSMutableArray alloc] init];和[[NSMutableArray alloc] initWithCapacity:0]区别
区别:第一个你创建NSMutableArray对象,它容纳对象个数是默认的。如果你知道最大需要的容量,那么就使用initWithCapacity:来设置,好处就是当元素个数不超过容量时,添加元素不需要重新分配内存。在with capacity的情况下,在初始化的时候分配的内存为n*sizeof(el...
分类:其他好文   时间:2015-06-11 18:31:24    阅读次数:179
LONG 转 CComBSTR
wchar_t* longStr = (wchar_t*) malloc(16*sizeof(wchar_t)); swprintf(longStr, L"%d", this->m_longAuthority); this->m_pToolTip->SetText(TEXT_K...
分类:其他好文   时间:2015-06-11 14:34:43    阅读次数:95
sizeof
ios 中sizeof(类型) 获取类型所占字节32位操作系统中, 每个字节占8个位64位操作系统中, 每个字节占16个位INT_MAX 2147483647int size1 = sizeof(long); //32位 4, 64位 8int size2 = sizeof(NS...
分类:其他好文   时间:2015-06-10 18:59:56    阅读次数:130
POJ 2195
#include//by Chengdacaizi#include#include#include#include#define MAXN 105#include #define inf 1000000000#define _clr(x) memset(x,0xff,sizeof(int)*n)us...
分类:其他好文   时间:2015-06-10 18:50:43    阅读次数:133
线性链表的c语言实现
#include<stdio.h>#include<stdlib.h>typedefintStatus;typedefintElemtype;typedefstructLNode{ Elemtypedata; structLNode*next;}*LinkList;StatusInitList(LinkList&L){ L=(LinkList)malloc(sizeof(LNode)); L->next=NULL; return1;}StatusDestoryList(L..
分类:编程语言   时间:2015-06-10 15:57:02    阅读次数:132
区间素数筛模版
区间素数筛模版筛出区间[a,b]的素数。(b-a prime;bool isP[maxn];vector P;void play_prime(){ memset(isprime,1,sizeof(isprime)); isprime[1]=0; for(int i=2;i<maxn...
分类:其他好文   时间:2015-06-10 14:08:01    阅读次数:101
网络流模板(更新中)
/* 最大流EK算法,O(V*E*E) */ #include #include #include const int N = 205; int n,m; int cap[N][N],f[N][N],pre[N],rest[N]; int sNode,eNode; void init(){ memset(f,0,sizeof(f)); memset(cap,0,sizeof(c...
分类:其他好文   时间:2015-06-09 23:42:57    阅读次数:146
java对象的内存布局(一):计算java对象占用的内存空间以及java object layout工具的使用
最近在学习java对象内存布局方面的一些知识,主要是想知道一个java对象到底占用多少内存空间,以及java对象在内存中到底是什么样子的。c/c++中的sizeof运算符能够方便地告诉我们一个变量占用的内存空间,但是在java中却没有直接提供这种机制。如果想获取java对象占用的内存大小,可以利用java的Instrumentation机制。在网上搜索的过程中看到了java object layout这个小工具,能够打印出类的布局信息。Java对象的内存布局:对象头(Header)、实例数据(Instanc...
分类:编程语言   时间:2015-06-09 21:59:43    阅读次数:218
Happy Number
1 class Solution { 2 public: 3 bool isHappy(int n) { 4 int dig[1000],cnt,ans; 5 memset(dig,0,sizeof(dig)); 6 while(1) 7 ...
分类:移动开发   时间:2015-06-09 21:36:03    阅读次数:140
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!