코딩Coding/Rust연습
rust연습]10진수 숫자 16진수로 알아보는 방법& 16진수를 10진수 숫자로 알아보는 방법
내인생PLUS
2022. 4. 17. 23:36
728x90
10 진수 숫자 16진수로 알아보는 방법
fn main() {
let i = 128150;
println!("{i:x?}");
}
결과
1f496
16 진수 숫자 10 진수로 알아보는 방법
use std::i64;
fn main() {
let z = i64::from_str_radix("1F496", 16);
println!("{:?}", z);
}
결과
Ok(128150)
출처 : https://stackoverflow.com/questions/32381414/converting-a-hexadecimal-string-to-a-decimal-integer
Converting a hexadecimal string to a decimal integer
I'm writing a Rust program that reads off of an I2C bus and saves the data. When I read the I2C bus, I get hex values like 0x11, 0x22, etc. Right now, I can only handle this as a string and save i...
stackoverflow.com
Rust]유니코드 출력하는 방법
Unicode print -
https://economiceco.tistory.com/m/13235
Rust]유니코드 출력하는 방법 Unicode print
Rust 로 유니 코드 출력하는 방법 되게 쉽다 ㅋㅋㅋ // unicode print fn main() { println!("\u{1f640}"); println!("\u{1f63b}"); } 결과 Running `target/debug/testrust` 🙀 😻 출처 : 프로그..
economiceco.tistory.com
반응형