Basma Ashour
Basma Ashour

Reputation: 33

How to split c++ console screen into parts?

I'm making a c++ console application, I want to split the console screen into parts and every part will print an individual output, to be more clear the console screen should be close to the design of Far Manger console app screen, but I have no idea how to start and what libraries should I use to do so. Sorry if it's a naive question but I seriously have no idea and couldn't find what I want when I made a search.

Upvotes: 0

Views: 2815

Answers (2)

PAWIU
PAWIU

Reputation: 1

maybe it will be useful to someone I wrote a class that can replace std and divide the terminal into 2 parts

CustomCout code: https://pastebin.com/6gU1a3wz

int main() {
    enable_ansi_codes();
    CustomCout custom_cout;
    custom_cout.set_mode(1); // cout prints in the left part
    cout << "Hello"

    custom_cout.set_mode(2); // cout prints in the right part
    cout << "World"

    return 0;
}

Upvotes: 0

polarysekt
polarysekt

Reputation: 572

If you want control of console text, such as positioning, or representation in a windowed fashion, have a look at ncurses.

Your target system may support escape sequences (see the wiki ANSI Escape Codes), or have particular API (as mentioned in the above comments) to implement console manipulation.

Upvotes: 2

Related Questions