Skip to content

How to create a console ?

Gammasoft edited this page Nov 13, 2023 · 4 revisions

| xtd | News | Gallery | Examples | Downloads | Documentation | Wiki | Support | Sources | Project | Gammasoft |

You can create a console application simply by using the static methods of the xtd::console class.

#include <xtd/console>
 
using namespace xtd;
 
auto main()->int {
  console::write("Hello ");
  console::write_line("World!");
  console::write("Enter your name: ");
  ustring name = console::read_line();
  console::background_color(console_color::blue);
  console::foreground_color(console_color::yellow);
  console::write("Good day, ");
  console::write(name);
  console::write_line("!");
}

The xtd::console class contains numerous properties and methods to help you control the terminal, cursor, colors and standard input, output and error streams.

See Guides and Reference Guide for more informations.

See