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