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,453
  • 4
  • 33
  • 50
Joe Beuckman
  • 2,204
  • 2
  • 23
  • 62

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
  • 880
  • 2
  • 15
  • 31
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,546
  • 5
  • 41
  • 62
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
  • 924
  • 16
  • 24