524 views|6 replies

60

Posts

0

Resources
The OP
 

Rust in Action: Mastering Rust's Basic Data Types [Copy link]

This post is from Programming Basics

Latest reply

This is indeed a good summary, I have learned a lot, thanks for sharing!  Details Published on 2024-4-26 07:12
 

60

Posts

0

Resources
2
 
Come on, let's review and study together! I should post the right module this time
This post is from Programming Basics
 
 
 

1110

Posts

1

Resources
3
 

Host:

fn main() {
let x: i32; // x is declared but not initialized, its value will be the zero value of type i32, i.e. 0
println!("The value of x is: {}", x); // Output: The value of x is: 0
}
Is there a requirement to declare global or static variables? Why does this code give me an error on RR? Initialization is required

This post is from Programming Basics

Comments

The old version is like this, the new version is about to be announced, I will change the description  Details Published on 2024-4-25 19:44
The old version is like this, the new version is about to be announced, I will change the description  Details Published on 2024-4-25 12:38
The old version is like this, the new version is about to be announced, I will change the description  Details Published on 2024-4-25 12:36
 
 
 

60

Posts

0

Resources
4
 
hellokitty_bean posted on 2024-4-25 09:14 Original poster: fn main() { let x: i32; // x is declared but not initialized, its value will be the zero value of type i32, that is, 0 ...

The old version is like this, the new version is about to be announced, I will change the description

This post is from Programming Basics
 
 
 

60

Posts

0

Resources
5
 
hellokitty_bean posted on 2024-4-25 09:14 Original poster: fn main() { let x: i32; // x is declared but not initialized, its value will be the zero value of type i32, that is, 0 ...

Starting from version 1.38, explicit initialization is required to enhance security and reduce undefined behavior

This post is from Programming Basics
 
 
 

1110

Posts

1

Resources
6
 
hellokitty_bean posted on 2024-4-25 09:14 Original poster: fn main() { let x: i32; // x is declared but not initialized, its value will be the zero value of type i32, that is, 0 ...

Hmm, thank you for the review and detailed description!

Like the OP!

Learn together and make progress together

This post is from Programming Basics
 
 
 

6827

Posts

11

Resources
7
 
This is indeed a good summary, I have learned a lot, thanks for sharing!
This post is from Programming Basics
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list