Got addstr to read string variable

This did not display anything when I worked on it this morning. Saving to be safe.
This commit is contained in:
Daniel Jones 2023-03-17 13:59:57 -05:00
parent cff6deaf6b
commit 49e69b0c6f

View File

@ -24,8 +24,8 @@ fn main() -> std::io::Result<()> {
let mut contents = String::new(); let mut contents = String::new();
file.read_to_string(&mut contents).expect("unreadable file."); file.read_to_string(&mut contents).expect("unreadable file.");
println!("{}", contents);
screen(); screen(&contents);
Ok(()) Ok(())
@ -33,10 +33,10 @@ fn main() -> std::io::Result<()> {
//screen init function //screen init function
fn screen(){ fn screen(line: &str){
ncurses::initscr(); ncurses::initscr();
ncurses::addstr("Hello World!"); ncurses::addstr(line);
ncurses::refresh(); ncurses::refresh();
ncurses::getch(); ncurses::getch();
ncurses::endwin(); ncurses::endwin();