当前位置:网站首页>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;
}边栏推荐
- 软考高级考试中有五大证书,哪个更值得考?
- Using Lex (Flex) to generate lexical analyzer of PL language
- Deploy LNMP automatically with saltstack
- Machine learning -- model evaluation, selection and verification
- Intermediate soft test (system integration project management engineer) high frequency test site
- Redis master-slave architecture (how to calculate sizeof function)
- What is the process of swing event processing?
- 云原生编程挑战赛火热开赛,51 万奖金等你来挑战!
- BeanFactory not initialized or already closed - call ‘refresh‘ before accessing beans via the Applic
- Cloud computing notes part.1 - system management
猜你喜欢

Question bank and answers of the latest national fire-fighting facility operators (intermediate fire-fighting facility operators) in 2022

Cell review: single cell methods in human microbiome research

CDGA|工业互联网行业怎么做好数据治理?

Basic knowledge of communication network 01

河北邯郸:拓展基层就业空间 助力高校毕业生就业

Common APIs in string

Getting started with enterprise distributed crawler framework

Oracle insert数据时字符串中有‘单引号问题

How does app automated testing achieve H5 testing

Leetcode Day1 score ranking
随机推荐
In the second half of 2022, the system integration project management engineer certification starts on August 20
Idea properties file display \u solution of not displaying Chinese
English translation Italian - batch English translation Italian tools free of charge
STC12C5A60S2 function description (STC12C5A60S2 is triggered by default)
MySQL8 基于clone创建主从复制
Hebei: stabilizing grain and expanding beans to help grain and oil production improve quality and efficiency
Crawl IP
毕马威中国:证券基金经营机构信息技术审计项目发现洞察
Android section 13 03xutils detailed explanation of database framework (addition, deletion and modification)
你知道雨的类型有几种?
NetCoreAPI操作Excel表格
Intermediate soft test (system integration project management engineer) high frequency test site
Common APIs in string
In order to develop high-end photoresist, Jingrui Co., Ltd. invested 75million yuan to purchase SK Hynix ASML lithography machine
The results of the second quarter online moving people selection of "China Internet · moving 2022" were announced
Can China make a breakthrough in the future development of the meta universe and occupy the highland?
【NPP安装插件】
Basic usage of docker
MySQL8 Encrypting InnoDB Tablespaces
Array method added in ES6