当前位置:网站首页>C language learning
C language learning
2022-07-07 23:45:00 【Assass1n-】
C Language learning
1. Define constants
usage : #define Constant names value
const data type Constant names = value
2. integer int
Print format
Print format | meaning |
---|---|
%d | Output one A signed Decimal system of int type |
%o( Letter o) | Output 8 It's binary int type |
%x | Output 16 It's binary int type , Letters are output in lowercase |
%X | Output 16 It's binary int type , Output letters in uppercase |
%u | Output one 10 It's binary An unsigned number |
Example
#include <stdio.h>
int main(void)
{
// data type identifier = value
// Unsigned unsigned A signed signed
signed a =-10;
//unsigned int a =10 This can be displayed normally If =-10 when There will be garbled code
printf("%d\n",a);// here unsigned It can output normally -10
//printf("%u\n",a);
return 0;
}
#include <stdio.h>
int main(void)
{
int a=10;
printf("%d\n",a);// Output 10
printf("%x\n",a);// Output a
printf("%X\n",a);// Output A
printf("%o\n",a);// Output 12
// Define octal data to 0 start
int b =0123;
// Definition 16 Hexadecimal data With 0x start
int c =0x123;
printf("%x\n",b);
printf("%X\n",b);
printf("%o\n",b);
printf("%x\n",c);
printf("%X\n",c);
printf("%o\n",c);
return 0;
}
边栏推荐
- 关于CH32库函数与STM32库函数的区别
- 保证接口数据安全的10种方案
- Anxin vb01 offline voice module access intelligent curtain guidance
- Stringutils tool class
- 受限线性表
- MP4文件格式解析之结合实例分析
- Ora-01741 and ora-01704
- 95.(cesium篇)cesium动态单体化-3D建筑物(楼栋)
- List. How to achieve ascending and descending sort() 2020.8.6
- Chisel tutorial - 02 Chisel environment configuration and implementation and testing of the first chisel module
猜你喜欢
Take you hand in hand to build Eureka client with idea
Right click the idea file to create new. There is no solution to create new servlet
Restricted linear table
激光slam学习(2D/3D、偏实践)
蓝桥ROS中使用fishros一键安装
How to change the formula picture in the paper directly into the formula in word
[experiment sharing] log in to Cisco devices through the console port
数据湖(十五):Spark与Iceberg整合写操作
Aitm3.0005 smoke toxicity test
Take you hand in hand to build Eureka server with idea
随机推荐
Live server usage
How to change the formula picture in the paper directly into the formula in word
Pigsty:开箱即用的数据库发行版
Progress broadcast | all 29 shield machines of Guangzhou Metro Line 7 have been launched
C simple question one
SAP HR 家庭成员信息
SLAM面试总结
一份假Offer如何盗走了「Axie infinity」5.4亿美元?
JNI uses asan to check memory leaks
HB 5469 combustion test method for non-metallic materials in civil aircraft cabin
Flash download setup
Codeworks 5 questions per day (average 1500) - day 8
Fibonacci number of dynamic programming
C language greedy snake
C number of words, plus ¥, longest word, average value
Reverse output three digit and arithmetic sequence
【7.5】15. Sum of three numbers
受限线性表
【汇总】看过的一些Panel与视频
[stm32+esp8266 connects to Tencent cloud IOT development platform 3] stm32+esp8266-01s dynamically registers devices on Tencent cloud (at instruction mode) -- with source code