how to fill other indexes of array after breaking it ...

Pages: 12
There are no standard C++ functions to clear the screen or read a character without a newline. The best you can do is to use a cross-platform library like ncurses. Alternatively you could use some conditional compilation and have multiple implementations of various functions. E.g.,

1
2
3
4
5
6
7
8
void clear_screen()
{
#ifdef _WIN32             // if it's Windows (32 or 64 bit)
    system("cls");
#else                     // else assuming linux (maybe also works with apple)
    system("clear");
#endif
}

Topic archived. No new replies allowed.
Pages: 12