I was wondering how to clear the console in c++.
I tried:
cout << "\x1B[2J\x1B[H";
and
system("cls");
The first option seemed to work on my computer but it didn't work on my friend's computer. The second option worked but many people recommended me not to use it because of many reasons. There is also a third option which is to print lots of new lines but that method is janky. Are there any other solutions to this? I have tried searching for solutions on here but most posts are from 10 years ago.