[英](C++) Using curses to print new line read in from file
The following is in a text file以下是一个文本文件
To the north, is the entrance to Room 2.\nThere are six suspects in this room:\n\tAdam\n\tSofia\n\tLucas\n\tDaniel\n\tChris\n\tJack\n\tTiana.
北面是 2 号房间的入口。\n这个房间里有六个嫌疑犯:\n\tAdam\n\tSofia\n\tLucas\n\tDaniel\n\tChris\n\tJack\n\tTiana。
This line is being read in and being stored.该行正在被读入和存储。 I am trying to use printw() to output this with the lines and tabs, however it just prints out as is with the '\n' and the '\t'.
我正在尝试将 printw() 用于 output 这与行和制表符,但它只是打印出来与 '\n' 和 '\t' 一样。 What are some possible solutions to this?
对此有哪些可能的解决方案?
Try using the printf() function. By checking the documentation they are the same functions, couldn't find the differences.尝试使用printf() function。通过查看文档它们是相同的功能,找不到差异。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.