-1

My question regards c++ and trying to create a window to ensure my output is all fit into a single line. The only way I can think to do this is to force another window to open up upon running the program and have the output appear there.

Does anyone know how to do this?

I am using XCode on my Mac. Anything Helps!

A. Takami
  • 318
  • 4
  • 16
  • What operating system? What terminal? – Trevor Hickey Sep 13 '16 at 02:07
  • 1
    In the 1400 pages that makes up the current C++ standard, there's not a single page that mention anything called a "terminal window". Sorry. – Sam Varshavchik Sep 13 '16 at 02:09
  • @SamVarshavchik fair. Poor phrasing. What is a term you would recommend then? – A. Takami Sep 13 '16 at 02:12
  • 1
    There is no term. There is nothing in the C++ standard concerning a terminal window, by any term. You need to look for documentation for your operating system-specific libraries and resources. Your question is not "regards C++", but about your operating system's libraries. – Sam Varshavchik Sep 13 '16 at 02:15
  • @SamVarshavchik okay I appreciate that. Thank you. Sorry – A. Takami Sep 13 '16 at 02:16
  • 1
    To emphasize why there's no such a thing: if I'm running your application over a telnet session initiated from Windows over a serial connection, do you expect your application be able to resize the Windows prompt as well? What about if using an [old teletype](https://en.wikipedia.org/wiki/Teleprinter)? (this is where the "terminal" originated from and, at least on some operating systems, you could theoretically connect [one of these](https://www.youtube.com/watch?v=FWa6u5_Itvs) and be able to interact with your OS - just a matter of connector availability, the software is still there) – Adrian Colomitchi Sep 13 '16 at 02:42

1 Answers1

1

The best you can do is to adjust your code to format the line within the bounds of the terminal you are using. For this, on OSX, you will need to use (and link) against termcap (short for 'terminal capabilities')

See also this one.

Community
  • 1
  • 1
Adrian Colomitchi
  • 3,974
  • 1
  • 14
  • 23