Is there any way to use cout for debugging while running an ncurses program in another window?

StackOverflow https://stackoverflow.com/questions/22897206

  •  28-06-2023
  •  | 
  •  

I'm playing around with a simple ncurses program to move sprites around a screen. Most of the backend logic is in C++. Apparently Xcode won't with ncurses at all, so I need some other way to debug my program. I don't know C or Unix that well - is there any way I could have my program spawn another Terminal window, which would run alongside the window where ncurses is running? I'd like to be able to use cout in that window to monitor the state of my program.

有帮助吗?

解决方案

Use gdb and the "attach" command to attach to your running process.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top