当前位置:网站首页>Clion and C language
Clion and C language
2022-07-01 03:06:00 【Lament the famine】
Clion And C Language
Clion Shortcut key Mac OS
Ctrl+A
Back to the beginning of the line
Ctrl+P
Go back to the end of the previous line
Ctrl+n
Go back to the end of the next line
Ctrl+m
Go back to the brackets in the range , Go back to the brackets in the range
Ctrl+D
Execute code
Ctrl+R
Execute code
*Ctrl+F
Next character
*Ctrl+B
Previous character
Ctrl+G
You can find the same character from the current position
*Ctrl+K
Deletes all subsequent characters from the current cursor position
C Basic knowledge of language
The data shows
Character type constants
Character constants are in single quotes ’‘ A character enclosed , Such as ’a’;
C In language , Characters are in accordance with their corresponding characters ASCII Code value to store , A character takes up a byte ,ASCII Code value common 0~255 individual ,256 It's worth , Be careful A space is also a character .
give an example :
char a = ' ';
printf("the space value is %d\n", a);
We put the space character ‘ ’ There are declared variables a in , Output in integer format , The output is ASCII Code value the value corresponding to the space character 32, Binary representation as :00100000, Take up one character length .
Special character constants
C There is a special class of character constants in languages , They represent control characters or special symbols , Such as carriage return, line feed, backspace, etc , They can't be shown on the screen , Nor can I type... From the screen , But we can use escape characters to represent these controls , The escape character is a backslash "" Followed by a character indicates , As in common use :\a,\b,\f,\n,\r,\t,\v,\,",’,?,\0;
The control characters are 32 individual , From the value from 000 To 031,null yes 000 Null character , and 032 Spaces are characters space. So we're calculating string In length , The number of space characters is also included , And when string constants are stored in memory , The system automatically adds “ String end flag ”, That is to say ASCII The code value is 0 Empty character of null, Use escape characters ’\0’ Express , So we are mainly clear about empty characters and space characters space The difference between .
String constant
String constants are in double quotation marks "" Several characters enclosed , For example, the length of the string is 1 The space character “ ”, Those without a single character in double quotation marks are called empty strings , The length is 0.
When string constants are stored in memory , The system automatically adds “ String end flag ”, That is to say ASCII The code value is 0 Empty character of null, Use escape characters ’\0’ Express , But it doesn't output ’\0’, So the length is n String constant for , In memory n+1 Bytes of storage space .
For strings with escape characters , The escape character should be evaluated as 1 Characters , Just because they don't show , So we use the backslash '' The plus character means they ( However, if the escape character does not match the escape character table, it will be ignored ), Do not participate in length calculation .
for example “AB\n” The length of such a string is 3.
Notice the difference between character constants and string constants , They are expressed in different forms , And the nature of storage is different , character constants ’S’ Occupy 1 Bytes , But string constants "S" Occupy 2 Bytes .
Symbolic constant
A constant represented by a symbol in a program is called a symbolic constant , Such as PI representative 3.14, Its advantage is that when our program needs the value of this symbol , Just modify one place .
C The macro is used to define commands in #define Define symbolic constants , Just like using char Define the same usage as character constants , Only there is no assignment symbol between identifier and Symbolic Constant .
边栏推荐
- 第03章_用户与权限管理
- CX5120控制汇川IS620N伺服报错E15解决方案
- Voici le programme de formation des talents de SHARE Creators!
- How the network is connected: Chapter 2 (Part 2) packet receiving and sending operations between IP and Ethernet
- Borrowing constructor inheritance and composite inheritance
- [applet project development -- Jingdong Mall] user defined search component of uni app (Part 1)
- Restcloud ETL data realizes incremental data synchronization through timestamp
- Introduction to webrtc concept -- an article on understanding source, track, sink and mediastream
- Use ipmitool to configure BMC network and user information of X86 server
- Redis 教程
猜你喜欢

Redis tutorial

Druid监控统计数据源

How to verify whether the contents of two files are the same

Chapter 03_ User and authority management

Here comes the share creators budding talent training program!

伺服第二编码器数值链接到倍福PLC的NC虚拟轴做显示
![[small program project development -- Jingdong Mall] the home page commodity floor of uni app](/img/80/20bed20a6ab91e82ad6800b11f2caa.png)
[small program project development -- Jingdong Mall] the home page commodity floor of uni app

Cloud native annual technology inventory is released! Ride the wind and waves at the right time
![[exsi] transfer files between hosts](/img/c3/128b72aca6e030b2d4be2b6bddbc43.png)
[exsi] transfer files between hosts

【小程序项目开发 -- 京东商城】uni-app 商品分类页面(上)
随机推荐
Multithreaded printing
[applet project development -- Jingdong Mall] user defined search component of uni app (Part 1)
LeetCode_栈_困难_227.基本计算器(不含乘除)
【小程序项目开发--京东商城】uni-app之自定义搜索组件(上)
一文讲解发布者订阅者模式与观察者模式
Poj-3486-computers[dynamic planning]
C#实现图的深度优先遍历--非递归代码
Magnetic manometer and measurement of foreign coins
彻底解决Lost connection to MySQL server at ‘reading initial communication packet
If a parent class defines a parameterless constructor, is it necessary to call super ()?
Restcloud ETL WebService data synchronization to local
Redis efficient like and cancel function
Restcloud ETL practice to realize incremental data synchronization without identification bit
MySQL index --01--- design principle of index
Introduction to kubernetes resource objects and common commands (II)
Mouse over effect 9
几行事务代码,让我赔了16万
Const and the secret of pointers
Optimal transport Series 1
别再说不会解决 “跨域“ 问题啦