The OP
Published on 2024-4-22 16:31
Only look at the author
This post is from Programming Basics
Latest reply
Because the latter is a reference, it should actually be &'static static reference, pointing to the static data area. You can also think that continuous move also points to the same area, so it is OK. The previous compilation will fail. You can think of it as the data on the stack. Move is taken away, which means the ownership is lost. For example, a heap new data cannot be referenced by multiple people, so there is a problem of multi-thread competition.
Details
Published on 2024-9-9 18:09
| ||
|
||
This post is from Programming Basics
| ||
|
||
|
hellokitty_bean
Currently offline
|
3
Published on 2024-4-23 09:44
Only look at the author
This post is from Programming Basics
| |
|
||
|
hellokitty_bean
Currently offline
|
4
Published on 2024-4-23 09:46
Only look at the author
This post is from Programming Basics
Comments
My superficial understanding is that s1 is of the String composite type (), s2 is of the &str type, and the & address operator is interesting. It means that Rust hard-codes "Hello" into the code at compile time, an immutable string (01010101...) and then let s2 = "Hel
Details
Published on 2024-4-23 14:31
| |
|
||
|
5
Published on 2024-4-23 11:46
Only look at the author
This post is from Programming Basics
Comments | ||
Personal signature
默认摸鱼,再摸鱼。2022、9、28 |
||
|
This post is from Programming Basics
| ||
|
||
|
This post is from Programming Basics
| ||
|
||
|
8
Published on 2024-9-9 18:09
Only look at the author
This post is from Programming Basics
| ||
|
||
|
EEWorld Datasheet Technical Support
EEWorld
subscription
account
EEWorld
service
account
Automotive
development
circle
About Us Customer Service Contact Information Datasheet Sitemap LatestNews
Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190