当前位置:网站首页>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;
}
边栏推荐
- HB 5469 combustion test method for non-metallic materials in civil aircraft cabin
- 解析token的网址
- Chisel tutorial - 01 Introduction to Scala
- postgres timestamp转人眼时间字符串或者毫秒值
- Anti climbing means cracking the second
- StringUtils工具类
- Svn relocation
- 数据库面试题+解析
- P1067 [noip2009 popularity group] polynomial output (difficult, pit)
- Display the server hard disk image to the browser through Servlet
猜你喜欢

Idea automatically generates serialVersionUID

Understand TCP's three handshakes and four waves with love

FFA与ICGA造影

How to change the formula picture in the paper directly into the formula in word
![[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](/img/55/ab50ead2564498cb214d98ac5b9c3d.jpg)
[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

MySQL Architecture
![[stm32+esp8266 connect Tencent cloud IOT development platform 2] stm32+esp8266-01s connect Tencent cloud](/img/78/3cc67a28872ff4d465484cbaee2f6e.jpg)
[stm32+esp8266 connect Tencent cloud IOT development platform 2] stm32+esp8266-01s connect Tencent cloud

神奇快速幂

【实验分享】通过Console口登录到Cisco设备

Apng2gif solutions to various problems
随机推荐
SAP 内存参数调优过程
B_ QuRT_ User_ Guide(39)
P5594 [xr-4] simulation match
Ora-01741 and ora-01704
Get started with mongodb
Display the server hard disk image to the browser through Servlet
BSS 7230 flame retardant performance test of aviation interior materials
May day C - most
Balanced binary tree [AVL tree] - insert, delete
HB 5469民用飞机机舱内部非金属材料燃烧试验方法
P1067 [noip2009 popularity group] polynomial output (difficult, pit)
C method question 1
Dependency injection 2 advantage lifecycle
List. How to achieve ascending and descending sort() 2020.8.6
HDU - 1260 tickets (linear DP)
JNI uses asan to check memory leaks
MongoDB快速入门
Aitm3.0005 smoke toxicity test
An example analysis of MP4 file format parsing
神奇快速幂