当前位置:网站首页>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;
}
边栏推荐
- Chisel tutorial - 01 Introduction to Scala
- P1067 [noip2009 popularity group] polynomial output (difficult, pit)
- 神奇快速幂
- Pigsty:开箱即用的数据库发行版
- [untitled]
- C method question 1
- Dataguard 主备清理归档设置
- Chisel tutorial - 00 Ex.scala metals plug-in (vs Code), SBT and coursier exchange endogenous
- 一份假Offer如何盗走了「Axie infinity」5.4亿美元?
- HDU - 1260 tickets (linear DP)
猜你喜欢
Archery installation test
AITM3.0005 烟雾毒性测试
An example analysis of MP4 file format parsing
Take you hand in hand to build Eureka server with idea
保证接口数据安全的10种方案
Open source hardware small project: anxinco esp-c3f control ws2812
How did a fake offer steal $540million from "axie infinity"?
Right click the idea file to create new. There is no solution to create new servlet
Flash encryption process and implementation of esp32
SAP 内存参数调优过程
随机推荐
C - Fibonacci sequence again
快速回复二极管整流特性
What if once again forgets the login password of raspberry pie? And you don't have a monitor yet! Today, I would like to introduce a method
P2141 [noip2014 popularization group] abacus mental arithmetic test
SAP HR reward and punishment information export
How to change the formula picture in the paper directly into the formula in word
Uic564-2 Appendix 4 - flame retardant fire test: flame diffusion
Interface
ASP. Net open web page
Chisel tutorial - 00 Ex.scala metals plug-in (vs Code), SBT and coursier exchange endogenous
HDU - 1260 Tickets(线性DP)
【7.5】15. Sum of three numbers
Oracle statistics by time
The file format and extension of XLS do not match
Stringutils tool class
C simple question one
Understand TCP's three handshakes and four waves with love
Take you hand in hand to build Eureka server with idea
May day C - most
2022.7.7-----leetcode.648