Shows how to use xtd::console::set_cursor_position, xtd::console::cursor_top and xtd::console::cursor_left methods.
#include <xtd/console>
auto orig_row = 0;
auto orig_col = 0;
void write_at(const string& s, int x, int y) {
console::set_cursor_position(orig_col + x, orig_row + y);
console::write(s);
}
auto main() -> int {
console::clear();
orig_row = console::cursor_top();
orig_col = console::cursor_left();
write_at("+", 0, 0);
write_at("|", 0, 1);
write_at("|", 0, 2);
write_at("|", 0, 3);
write_at("+", 0, 4);
write_at("-", 1, 4);
write_at("-", 2, 4);
write_at("-", 3, 4);
write_at("+", 4, 4);
write_at("|", 4, 3);
write_at("|", 4, 2);
write_at("|", 4, 1);
write_at("+", 4, 0);
write_at("-", 3, 0);
write_at("-", 2, 0);
write_at("-", 1, 0);
write_at("All done!", 0, 6);
console::write_line();
}
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10