码迷,mamicode.com
首页 >  
搜索关键字:sizeof    ( 5917个结果
windows 64位整数
#include #include using namespace std;int main(){ cout << sizeof(long) << endl;//4 cout << sizeof(long long) << endl;//8 cout << sizeof(__int...
分类:Windows程序   时间:2014-09-10 23:45:41    阅读次数:286
HDU1159 && POJ1458:Common Subsequence(LCS)
最长公共子序列LCS有模板的吧#include#include#includeusing namespace std;int i,j,dp[1000][1000],len1,len2;char a[1000],b[1000];void LCS(){ memset(dp,0,sizeof(dp)...
分类:其他好文   时间:2014-09-10 22:18:01    阅读次数:167
C++ - "'itoa' was not declared in this scope" 错误
"'itoa' was not declared in this scope" 错误本文地址: http://blog.csdn.net/caroline_wendyitoa函数不是ANSI(American National Standards Institute) C的标准, 应该避免使用这个函数.简易替代版本为://itoa(i, s, 10); snprintf(s, sizeof(s),...
分类:编程语言   时间:2014-09-10 17:45:26    阅读次数:959
【C语言】构造长度可变的二维数组
1 #include 2 #include 3 #include 4 5 int getArray(int ***p,int m,int n)//构造一个m*n维数组,并清零 6 { 7 int i; 8 *p=(int **)malloc(sizeof(int*)*m);...
分类:编程语言   时间:2014-09-10 17:23:00    阅读次数:229
原串与其逆序串 对应位置且 连续最大长度
#include #include #include #include using namespace std;int main(){ char s[1000]; char t[1000]; int len; int i, j; memset(s, '\0', sizeof(s)); m...
分类:其他好文   时间:2014-09-09 20:01:39    阅读次数:203
【ThinkingInC++】42、类里的const
Const在建立它的地方被初始化。Const修饰无法修改。 关于static const类型是:所有的对象共享且不变的数据。 http://blog.csdn.net/luoweifu/article/details/20288549 输出本地时间: time_t t = time(0); char tmp[64]; strftime( tmp, sizeof(tm...
分类:编程语言   时间:2014-09-09 13:18:58    阅读次数:231
C++面试题6:sizeof 使用规则及陷阱
C++面试题6:sizeof 使用规则及陷阱 cout sizeof(int) //32位机上int长度是4cout sizeof(1==2) //bool类型,相当于cout 陷阱: int a=0; cout sizeof(a=3) //sizeof作用范围内,也就是括号里面的内容不能被编译,而是被替换成类型,=操作符返回左操作数的类型,所以a=3相当于int 4cout //输出0...
分类:编程语言   时间:2014-09-08 10:54:56    阅读次数:351
C++面试题5:建议在函数里面不要用sizeof算数组的大小
C++面试题5:建议在函数里面不要用sizeof算数组的大小 #include using namespace::std; void foo(const int[]); int main() { int arr[3] = {1,2,3}; cout"in main array size: "sizeof(arr)/sizeof(int)<<endl; foo(arr); ...
分类:编程语言   时间:2014-09-08 10:54:46    阅读次数:296
sg函数
两种方法: 1.dfs求法 int mex(int n) { if(sg[n]!=-1) return sg[n]; int temp; bool vis[N]; memset(vis,false,sizeof(vis)); for(int i=0;i=arr[i];i++) { temp=n-arr[i]; s...
分类:其他好文   时间:2014-09-05 22:29:22    阅读次数:208
uva 11762 Race to 1
记忆化搜索的方式计算f(x) #include #include #include #include using namespace std; #define mem(a) memset(a,0,sizeof(a)) const int maxn = 1000005; int n; int primes[maxn],prime_cnt; int vis[maxn]; int v[maxn]; ...
分类:其他好文   时间:2014-09-04 19:02:50    阅读次数:208
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!