当前位置:网站首页>Discussion on memset assignment
Discussion on memset assignment
2022-07-05 14:09:00 【Crayon gold QAQ】
memset assignment
As far as possible with 0x3f3f3f3f assignment , such memset Assignment result and “=” The effect of assignment number is the same , There will be no mismatches .
0x7fffffff Empathy (7 individual f)
This is the running code
You can see that for memset, These four methods are equivalent .
#include <bits/stdc++.h>
using namespace std;
int a[100];
int main()
{
memset(a, 0x3f, sizeof(a));
cout << a[0] << endl;
memset(a, 0x3f3f, sizeof(a));
cout << a[0] << endl;
memset(a, 0x3f3f3f, sizeof(a));
cout << a[0] << endl;
memset(a, 0x3f3f3f3f, sizeof(a));
cout << a[0] << endl;
cout << 0x3f << endl;
cout << 0x3f3f << endl;
cout << 0x3f3f3f << endl;
cout << 0x3f3f3f3f << endl;
return 0;
}
Running results :
1061109567
1061109567
1061109567
1061109567
63
16191
4144959
1061109567
边栏推荐
- Sorter evolution of ticdc 6.0 principle
- Fault analysis | analysis of an example of MySQL running out of host memory
- 享你所想。智创未来
- Jetpack compose introduction to mastery
- 神经网络物联网未来现状和趋势及看法
- SSH免密码登录详解
- 常见问题之PHP——Fatal error: Allowed memory size of 314572800 bytes exhausted...
- Elfk deployment
- ::ffff:192.168.31.101 是一个什么地址?
- Current situation, trend and view of neural network Internet of things in the future
猜你喜欢
::ffff:192.168.31.101 是一个什么地址?
What are the advantages and characteristics of SAS interface
治臻新能源冲刺科创板:年营收2.2亿 上汽创投是股东
如何将 DevSecOps 引入企业?
Zhizhen new energy rushes to the scientific innovation board: the annual revenue is 220million, and SAIC venture capital is the shareholder
Brief introduction to revolutionary neural networks
PHP basic syntax
:: ffff:192.168.31.101 what address is it?
Those things I didn't know until I took the postgraduate entrance examination
SAS接口有什么优势特点
随机推荐
Can graduate students not learn English? As long as the score of postgraduate entrance examination English or CET-6 is high!
js 从一个数组对象中取key 和value组成一个新的对象
Financial one account Hong Kong listed: market value of 6.3 billion HK $Ye wangchun said to be Keeping true and true, long - term work
Jetpack compose introduction to mastery
Elk enterprise log analysis system
广发期货排名多少?网上办理广发期货开户安全可靠吗?
Deep copy is hard
Sqllab 1-6 exercise
Xampp configuring multiple items
01 、Solr7.3.1 在Win10平台下使用jetty的部署及配置
用“新”字来吸引好奇的人群
3W原则[通俗易懂]
Interpretation of tiflash source code (IV) | design and implementation analysis of tiflash DDL module
锚点导航小demo
Make the seckill Carnival more leisurely: the database behind the promotion (Part 2)
upload (1-6)
[machine learning notes] how to solve over fitting and under fitting
Scenario based technology architecture process based on tidb - Theory
最简单不用证书也可以多开功能的方式
POI set the data format of the column (valid)