#include "clinput.h" Tunit & CLInput(Tunit & tu, string msg){ int nn =0; double iv; int i; while (tu.table[nn].cvalue) { cout << nn << ": " << tu.table[nn].unit << endl; nn++; } cout << endl << msg << endl; cin >> iv; cin >> i; while ((i < 0) ||(i >= nn)) { cout << "Invalid unit type: reenter unit" << endl; cout << iv << " "; cin >> i; } tu.SetIndex(i); tu.SetValue(iv); return tu; }