Update main.rs

Added ncurses function
This commit is contained in:
Daniel Jones 2023-03-16 21:58:32 -05:00
parent ba1b7ec819
commit 461ca2a884

View File

@ -1,7 +1,7 @@
use std::fs::File; use std::fs::File;
use std::io::prelude::*; use std::io::prelude::*;
use std::env; use std::env;
use ncurses; extern crate ncurses;
fn main() -> std::io::Result<()> { fn main() -> std::io::Result<()> {
let args: Vec<String> = env::args().collect(); let args: Vec<String> = env::args().collect();
@ -13,5 +13,18 @@ fn main() -> std::io::Result<()> {
file.read_to_string(&mut contents).expect("unreadable file."); file.read_to_string(&mut contents).expect("unreadable file.");
println!("{}", contents); println!("{}", contents);
screen();
Ok(()) Ok(())
}
fn screen(){
ncurses::initscr();
ncurses::printw("Hello World!");
ncurses::refresh();
ncurses::getch();
ncurses::endwin();
} }