Create simple input interface

Hi,

I am trying to create a simple interface on console to allow to input some values to some variables. For ex:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
int main() {
   double a = 1.5;
   double b = 2.5;
   double c = 3.5;
   string x;
   
   cout << "Enter a = " << a;     // display the value by default
   getline(cin, x);               // receive user input
   if(!x.empty()){                // check whether input is empty
      x >> a;
   }
   cout << endl;

   cout << "Enter b = " << b;
   getline(cin, x);
   if(!x.empty()){ 
      x >> b;
   }
   cout << endl;

   cout << "Enter c = " << c;
   getline(cin, x);
   if(!x.empty()){
      x >> c;
   }
   cout << endl;
   cout << "sum = " << a + b + c << endl; // display the result

   return 0;
}


However, I want these three to display at the same time (now they display one by one), and in the console window I can move the cursor between input place of a, b and c with "arrow key" of keyboard.

Could anyone please help me? Thanks!
What you want to do is not possible with standard C++. Google gotoxy().
To clarify... it's not possible with the standard lib. It's certainly possible in C++.

Anyway this isn't going to be as simple as you might think. A 'gotoxy' type function is only going to be one piece of the solution.
Topic archived. No new replies allowed.