samedi 2 juillet 2016

Using ncurses and c++ to read and open/display a txt file

I'm pretty new to c++ as a student, and very new to the ncurses lib, and I need to use an ncurses window to display the contents of a txt file.

I'm having trouble finding the best way to approach this. I know how to open .txt files and how to read using getline and the the insertion operator >> (for simpler txt blocks), but I'm not sure how to do this with an ncurses window.

I've looked into the HOWTO on tdlp.org and printw, but it seems that printw only works with a c-string parameter, and (to my (little) knowledge), that would just be a mess with spaces and new lines.

Could anyone with more knowledge with curses point me in the right direction? Thanks

Aucun commentaire:

Enregistrer un commentaire