1

I have a large program written in C++ that uses std::cout in a lot of places. I am building an NCurses version and std::cout destroys that interface.

Is there a way to reroute the console output from std::cout to something like cdk_swindow?

GraphicsMuncher
  • 4,583
  • 4
  • 35
  • 50
Joe Beuckman
  • 2,264
  • 2
  • 24
  • 63

3 Answers3

0

A simple way to do this would be to override the << operator. This way in your case you can use cdk_swindow

Alwin Doss
  • 962
  • 2
  • 16
  • 33
0

I rememeber std:cout didn't work in ncurses framwork and i use printf function, you use a regex with sed and convert you std:cout to printf function.But it's hard code and dirty anyway.

PersianGulf
  • 2,845
  • 6
  • 47
  • 67
0

I'd look at the CDK examples (http://invisible-island.net/cdk/)

Since CDK 'takes over' an Xterm, you probably will want to create a wrapper function that spews the text that used to go to the console, into something like CDKVIEWER.

mrflash818
  • 930
  • 13
  • 24