当前位置:网站首页>C language learning log 12.14
C language learning log 12.14
2022-06-13 04:57:00 【Today is also a day without baldness】
One . Escape character
Used to express control characters or special characters that cannot be printed , It's made up of a backslash “\“ start , Followed by another character , These two characters combine , Make up a character .

Two . character string
It is a 0( Integers 0) A string of characters at the end ,0 or ”\0" It's the same , But and '0' Different
0 Marks the end of the string , But it's not part of a string , This is not included when calculating the length of the string 0
String exists as an array , Access as an array or pointer , More in the form of pointers
string.h There are many functions to handle strings in .
Tips: C Language strings exist in the form of character arrays
You cannot operate on a string with an operator
You can traverse the string through the array
String variable : String constant :
The string can be stored in the following form : for example :char* s ="Hello,world!";
char * Variable name = "Hello"; s It's a pointer , Initializes to point to a string char Variable name [] = "Hello"; The amount , Because of where this constant is , actually s yes char Variable name [10] = "Hello"; const char* s, But for historical reasons , compile Device not accepted const Writing . But try to s Referred to Writing strings can lead to serious consequences .
If you need to modify the string , You should use arrays :
char s[] = "Hello,world!";
So use a pointer or an array ?
Array : This string is here
The space is automatically reclaimed as a local variable
The pointer : I don't know where this string is
Processing parameters
Dynamically allocate space
边栏推荐
- Section 5 - Operator details
- Spread your wings and soar
- Shell variable learning notes
- 2022年建筑架子工(建筑特殊工种)特种作业证考试题库及在线模拟考试
- JS to realize the conversion between string and array and an interview question
- QT signal is automatically associated with the slot
- Test question bank and online simulation test for special operation certificate of construction scaffolder (special type of construction work) in 2022
- Differences between string() and tostring() methods
- [leetcode]- sliding window
- Reductive elimination
猜你喜欢

Internet people a few years ago vs Internet people today

Section 3 - functions

Bomb disposal cat

Section 8 - Practical commissioning techniques

QT direction key to move focus

QT client development -- driver loading problem of connecting to MySQL database
![[try to hack] upload labs (temporarily write to 12)](/img/df/dbb78121f7428e25ffb73cfc43ce1b.png)
[try to hack] upload labs (temporarily write to 12)

Spread your wings and soar

Createanonymousthreadx passes parameters to anonymous threads

Section 7 - structures
随机推荐
Use go to add massive data to MySQL
详解OpenCV的函数cv::add(),并附各种情况的示例代码和运行结果
QT realizes message sending and file transmission between client and server
Elliptic curve encryption
E - Lucky Numbers
无限循环滚动代码阿里巴巴国际站店铺装修代码底图滚动黑色半透明显示效果自定义内容装修代码全屏显示
Section 8 - Practical commissioning techniques
String()和toString()方法得区别
Shell variable learning notes
rainbow
Mind mapping series - Database
The processing flow of thread pool depends on the core parameters
E - Lucky Numbers
Tita: Xinrui group uses one-to-one talk to promote the success of performance change
Logical point
How to understand JS expressions and JS statements
QT client development -- driver loading problem of connecting to MySQL database
Hidden implementation and decoupling, knowing Pimpl mode
Recommended temporary online image compression tool
Blockly learning ----2 Code generation, grid, scaling, events, storage