1

How can I wrap a string which I want it to be displayed on console considering the column size of the console. I do not want to use "std::cout" as we do not use it in our project. To be specific, I do not want to modify the stream. Rather I wanted to modify the string itself. Is there any way to do that ? Please help. I should also mention that solution in c++11 might not help me as we do not have support for it in our project.

Mariners
  • 499
  • 8
  • 18
  • What do you mean by `wrap` exactly? Do you care about splitting word or not? – Holt Jul 10 '15 at 07:40
  • getting the terminal width is quite platform dependent, you can e.g. use ncurses on Linux ( http://stackoverflow.com/questions/1022957/getting-terminal-width-in-c ) or dedicated functions for windows: http://stackoverflow.com/questions/8627327/how-to-get-number-of-characters-in-line-in-console-that-my-process-is-bind-to – Andre Holzner Jul 10 '15 at 07:51
  • well I am not bothered about whether a word is split or not. But When the console is dragged in, the text paragraph (lets say) should look like a paragraph only. There should not be non-uniform line-feeds or white-spaces and all. – Mariners Jul 12 '15 at 04:22

0 Answers0