Thanks for all your help so far guys, I appreciate it!
#3
The Problem - I need to clear the screen in the middle of a program.
The code -
Code:
#include <iostream>
using namespace std;
int main()
{
int choice;
cout << "Your choice: ";
cin >> choice;
if ( choice == 1 ) {
system("format a:");
cin.ignore();
cin.get();
}
else if (choice == 2) {
system("format a:");
cin.get();
cin.ignore();
}
else {
cout << "Your choice is invalid.";
cin.ignore();
cin.get();
}
}
Today I found the 'system' function and IF statements, this seems like a good way to test them out. Anyway, what I want is; when a number (choice) is entered the screen needs to be cleared. Then whatever that choice entails is to be carried out on a blank screen.
#4
The Problem - I need to restart the program.
The code -
Code:
#include <iostream>
using namespace std;
int main()
{
int choice;
cout << "Your choice: ";
cin >> choice;
if ( choice == 1 ) {
system("format a:");
cin.ignore();
cin.get();
}
else if (choice == 2) {
system("format a:");
cin.get();
cin.ignore();
}
else {
cout << "Your choice is invalid.";
cin.ignore();
cin.get();
}
}
So, after a choice is entered and whatever carried out I want to restart the program at the 'menu' bit.