当前位置:网站首页>Learning records of programming -- Lesson 2 [first knowledge of C language]
Learning records of programming -- Lesson 2 [first knowledge of C language]
2022-07-27 06:22:00 【Autumn mountain chariot God AE】
Constant
1. Literal constants , Such as π.2.const Defined constant , Has constant properties , But it's actually a variable .
3. Constant of identifier Such as #define #define tall 186,4. Enumeration constants enum( Enumerate keywords ).
Escape character
\0 End flag for string printing . When initializing an array , If array element is a string , You need to bring \0.
\ddd Express 1-3 Eight digit octal number , Octal digit range 0-8.\xdd Represents two hexadecimal digits .
The operator
In front of ++, Say first ++, Post assignment , After ++, Indicates assignment first , after ++.
example a=10,b=++a, obtain a=b=11, if b=a++, be b=10,a=11.
scanf The value returned by the function is the number of characters entered , Writable loop while( scanf("%d",&A)!=EOF), Indicates that the number of characters entered meets the requirements ,EOF The value of is -1.
Cast
( type ) You can implement cast for example int m=(int)3.1415, Put floating-point numbers 3.1415 Cast to integer .
Conditional operators
exp1?exp2:exp3, example (a>b)?a:b, Said when a>b Output when the condition is true a value , Otherwise output b value .
边栏推荐
猜你喜欢

遥感影像识别-多类识别下的错分问题

Robot navigation

Multi threaded CAS, synchronized lock principle, JUC and deadlock

Random points in non overlapping rectangle (force deduction daily question)

力扣每日一题(链表模拟)

Unity practical tips (updating)

如何选择正确的服务器备份方法

Unity engine starts to migrate from mono to.Net coreclr

Remote sensing image recognition training strategy

Pzk's first understanding of pointer in learning C language
随机推荐
Wireshark IP address domain name resolution
UnityShader-LowPoly
Unity 菜单界面的简单介绍
Solve binary tree (6)
Unity 引擎开始从 Mono 迁移到 .NET CoreCLR
网络原理的简单认识
IP核之ROM
多线程的相关知识
Force buckle 160. intersecting linked list
Automated Deployment Project
Brief introduction to unity menu interface
5g network identity - detailed explanation of 5g Guti
Remote sensing image recognition - making data sets
哈希表的原理及哈希冲突的解决方法
Li Kou 236. the nearest common ancestor of binary tree
租用香港服务器时单线与三线有什么区别?
Unity 实用小技巧(更新ing)
wireshark数据包修改--添加或修改消息字段(二)
IP核小结
论文报告-Linear Regression for face recognition