当前位置:网站首页>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;
}
边栏推荐
- May day d-light
- HB 5469 combustion test method for non-metallic materials in civil aircraft cabin
- SAP HR 家庭成员信息
- Alibaba cloud MySQL cannot connect
- 平衡二叉樹【AVL樹】——插入、删除
- P1067 [noip2009 popularity group] polynomial output (difficult, pit)
- c—线性表
- 快速回复二极管整流特性
- Chisel tutorial - 04 Control flow in chisel
- C simple question 2
猜你喜欢
[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
ESP at installation esp8266 and esp32 versions
95.(cesium篇)cesium动态单体化-3D建筑物(楼栋)
SAP HR reward and punishment information export
Take you hand in hand to build Eureka server with idea
C method question 1
Flash encryption process and implementation of esp32
Understand TCP's three handshakes and four waves with love
How to change the formula picture in the paper directly into the formula in word
SAP HR family member information
随机推荐
关于CH32库函数与STM32库函数的区别
Dependency injection
B_ QuRT_ User_ Guide(39)
Chisel tutorial - 05 Sequential logic in chisel (including explicit multi clock, explicit synchronous reset and explicit asynchronous reset)
蓝桥ROS中使用fishros一键安装
Ora-02437 failed to verify the primary key violation
C language greedy snake
Idea automatically generates serialVersionUID
【7.5】15. Sum of three numbers
KeePass realizes automatic input of web pages
AITM3.0005 烟雾毒性测试
SAP HR reward and punishment information export
【7.5】15. 三数之和
Pycharm essential plug-in, change the background (self use, continuous update) | CSDN creation punch in
一份假Offer如何盗走了「Axie infinity」5.4亿美元?
ESP at installation esp8266 and esp32 versions
Aitm3.0005 smoke toxicity test
c—线性表
SAP HR social work experience 0023
数据分析系列 之3σ规则/依据拉依达准则来剔除异常值