当前位置:网站首页>Two methods to judge the size end
Two methods to judge the size end
2022-07-28 20:01:00 【Hello_ World_ two hundred and thirteen】
Clarify the concept of large and small ends :
The small end : The low order data is stored at the low address , The high bit is stored at the high address
Big end : The high data is stored at the low address , The low address is stored at the high address
#include<stdio.h>
#include<windows.h>
void project1()
{
int a = 1, count = 0;
count = *(char*)&a;
if (count == 1)
{
printf(" The small end \n");
}
else
{
printf(" Big end \n");
}
}
void project2()
{
union un
{
char a;
int b;
}u1;
u1.b = 1;
if (u1.a == 1)
{
printf(" The small end \n");
}
else
{
printf(" Big end \n");
}
}
int main()
{
project1();
project2();
system("pause");
return 0;
}边栏推荐
- leetcode day3 超过经理收入的员工
- Serial port receiving application ring buffer
- 河北:稳粮扩豆助力粮油生产提质增效
- Common APIs in string
- 架构基本概念和架构本质
- MySQL8 Status Variables: Internal Temporary Tables and Files
- Read how to deploy highly available k3s with external database
- Redis笔记
- How navicate modifies the database name
- C language function
猜你喜欢

Intermediate soft test (system integration project management engineer) high frequency test site

Article translation software - batch free translation software supports major translation interfaces

NetCoreAPI操作Excel表格

中国能否在元宇宙的未来发展中取得突破,占领高地?

There is a 'single quotation mark' problem in the string when Oracle inserts data

Codeignier framework implements restful API interface programming

KPMG China: insights into information technology audit projects of securities fund management institutions

【NPP安装插件】

English Translation Spanish - batch English Translation Spanish tools free of charge

Cdga | how can the industrial Internet industry do a good job in data governance?
随机推荐
Labelme (I)
[NPP installation plug-in]
English translation Italian - batch English translation Italian tools free of charge
MySQL 8 creates master-slave replication based on Clone
Machine learning -- model evaluation, selection and verification
Cell review: single cell methods in human microbiome research
MATLAB实现的图像分割之边缘检测和连接
How does app automated testing achieve H5 testing
Common APIs in string
English translation Portuguese - batch English conversion Portuguese - free translation and conversion of various languages
Redis master-slave architecture (how to calculate sizeof function)
C language operators and input and output
NPM installing and uninstalling global packages
数字图像理论知识(一)(个人浅析)
Amazon launched Amazon one palm payment system, and the contactless palm vein recognition market is expected to explode
Andorid system layout, values, drawable adaptation
Basic knowledge of communication network 01
JS batch add event listening onclick this event delegate target currenttarget onmouseenter OnMouseOver
Intermediate soft test (system integration project management engineer) high frequency test site
Overcome the "fear of looking at teeth", and we use technology to change the industry