码迷,mamicode.com
首页 > 其他好文 > 详细

memset赋值

时间:2018-09-23 22:16:20      阅读:250      评论:0      收藏:0      [点我收藏+]

标签:names   sizeof   mes   turn   its   size   ret   关系   pre   

比较神奇的事情

可能和二进制有关系吧

#include<bits/stdc++.h>

using namespace std;

int f[1000];
int main(){
    memset(f,127,sizeof f);
    for(int i=0;i<=10;i++) printf("%d ",f[i]);return 0;
}结果:2139062143  inf
#include<bits/stdc++.h>

using namespace std;

int f[1000];
int main(){
    memset(f,128,sizeof f);
    for(int i=0;i<=10;i++) printf("%d ",f[i]);return 0;
}结果:-2139062144  -inf

 

memset赋值

标签:names   sizeof   mes   turn   its   size   ret   关系   pre   

原文地址:https://www.cnblogs.com/asdic/p/9693652.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!