I am currently trying to print some thing on the console. Similar to loading in same line using "\r" but instead I have endl included.
#include <iostream>
int main(int argc, char **argv)
{
int x = 3;
// first part
std::cout << " x = " << x <<"\n";
std::cout << " y = " << x <<"\n";
std::cout << " z = " << x << "\n";
std::cin >> x ;
std::cout << "\r" << std::flush;
// second part
std::cout << " x = " << x <<"\n";
std::cout << " y = " << x <<"\n";
std::cout << " z = " << x <<"\n";
return 0;
}
The above code prints the first part and prints again the second part in different place. So the total column is eight. What I actually want is to print the first part take input from user and then replace the first part with second part. This way total column is 3.