Linked Questions

8 votes
3 answers
7k views

I have a C++ class MyObject and I want to be able to feed this data like I would to a osstream (but unlike a direct sstream, have the incoming data be formatted a special way). I can't seem to figure ...
The Unknown's user avatar
  • 19.8k
6 votes
2 answers
3k views

I would like to do dup2(fd, 1); close(fd); and have ::std::cout write to the new fd 1. How do I can reset the state of ::std::cout so nothing goes funny? For example, is flushing beforehand sufficient?...
Omnifarious's user avatar
  • 56.4k
0 votes
3 answers
3k views

How can I print an string with padding in C++? Specifically what I want is: cout << "something in one line (no prefix padding)" cout << "something in another line (no prefix padding)" ...
JohnTortugo's user avatar
  • 6,665
2 votes
1 answer
1k views

I want to check whether output is written to the standard output (through cout) in a certain part of my program. What I found is a way to block any output by changing the streambuf of cout. (here:C++:...
Older Shatterhand's user avatar
2 votes
2 answers
500 views

I have implemented a simple ostream and streambuf class. For some reason, it crashes when I try to instantiate my AndroidLogOStream object. Note: I have stlport_static in my Application.mk class ...
KaiserJohaan's user avatar
  • 9,290
1 vote
2 answers
1k views

So I've browsed a bunch of other threads, but none pertain to the questions I have on this exact topic. I am writing a C++ library to do socket communication. I have a TCP socket class which handles ...
Timmah339's user avatar
6 votes
0 answers
2k views

I have a library, which sends messages to the console using std::cout and std::cerr. I know, I can redirect that in my GUI Application. But, what I wonder is, if there is a way to detect if cout or ...
Kağan Kayal's user avatar
  • 2,503
0 votes
1 answer
617 views

I am working a big legacy project and need to redo the common logger. I tried to make same logger interface with before to avoiding changing ton of loggers. The reason I need to redo the logger is the ...
Alanaa's user avatar
  • 65
0 votes
1 answer
338 views

I was wondering if it is possible to simulate a typewriter effect (Meaning pause inbetween each character.) but from the cout global class. For example cout << "Hi, this is a cow." << ...
cow9000's user avatar
  • 39
0 votes
1 answer
68 views

In my application I have a console (which uses std::out) and a window (that has a function to show some text). What I'm looking for is a way to show the last line of cout in my window. I've read some ...
Timo's user avatar
  • 9,985