Написал код, все отлично, однако когда у меня спрашивает продолжить или нет, я выбираю продолжить, он не начинает все с начала, а сразу же выдает 2 cout'a.
int main(int argc, char *argv[])
{
cout << "1. Copy File" << endl;
cout << "2. Move File" << endl;
cout << "3. Rename File" << endl;
cout << "4. Delete File" << endl;
cout << "5. Format Disc" << endl;
cout << "6. Search" << endl;
cout << "7. Clear Cash" << endl;
cout << "8. Download File" << endl;
cout << endl;
char v = getch();
do {
if (v=='1')
cout << "Copy File Function" << endl; cout << endl;
{
char path1[100], path2[100];
cout << ">> Type First Adress <<" << endl;
cin.getline (path1, 100);
cout << endl;
cout << ">> Type Second Adress <<" << endl;
cin.getline (path2, 100);
CopyFile(path1,path2, true);
cout << endl;
cout << " File is Copied " << endl ; cout << endl;
cout << " Do you want to continue? (Y/N)? " << endl;
cin >> v;
if( v == 'y') {
system("cls");
}
}
} while (v != 'n');
system("PAUSE");
return EXIT_SUCCESS;
}
Вот после нажатия "Y" он очищает экран, но сразу же выдает
>> Type First Adress <<
а за ним
>> Type Second Adress <<
Вопрос:
Как сделать, чтобы нажатия "Y" он зачистил экран и выдал все с нуля, как бы я перезапустил программу, снова он выдал меню (1,2,3,,4,5,6,7,8) и просил меня выбирать 1 из этих процессов?
Надеюсь смог донести свои мысли