test concluant

This commit is contained in:
2025-04-05 16:01:41 +02:00
parent 79bd1f3cc4
commit ebd3e33a03
3 changed files with 16 additions and 6 deletions

2
fo.txt Normal file
View File

@@ -0,0 +1,2 @@
éè
é

View File

@@ -1,8 +1,15 @@
use std::fs::File;
use std::io::prelude::*;
fn main() { fn main() -> std::io::Result<()> {
let mut u:i8 = 0b000_0001; let mut file = File::open("test.txt")?;
let tab:[i8; 5] = [50,0,0,0,0]; let mut contents = String::new();
let mut i = tab[0]; file.read_to_string(&mut contents)?;
println!("Tableau (debug) : {:?}", tab); for i in 0..contents.len() {
println!("{i}"); println!("{:?}", contents.chars().nth(i));
}
contents.push('é');
let mut file2 = File::create("fo.txt")?;
file2.write_all(contents.as_bytes())?;
Ok(())
} }

1
test.txt Normal file
View File

@@ -0,0 +1 @@
éè