I uninstalled DevCpp and reinstalled. Same problem. Maybe it is the code. Now hoever, there's one error that won't even let it compile that I can't figure out. (Jeeze this is a wreck huh?) It says:
2
C:\Documents and Settings\Start\My Documents\Eli\C++\Projects\CM\2
unable to run program file.
It used to compile, and only do system("PAUSE");, now it just doesn't compile. I don't know how much you guys wanna see so.... O.o here's everything I have done, and thanks for your time:
Code:
//Just so you all know, this isn't meant to work correctly yet.
//but this SHOULD compile. Anyways, I'm a beginner, so any help would be
//much appreciated.
#include <iostream>
#include <vector>
#include <fstream>
#include <strings>
using namespace std;
class contact{
public:
contact(string* name){
firstName=*name;
}
protected:
string firstName;
};
class list{
public:
list(string* name){
listName=name
}
void nCont();{
return;
}
void eCont();{
return;
}
void vCont();{
return;
}
void dCont();{
return;
}
protected:
string listName;
vector<contact> contactList;
};
void cList(); // Create list
void lList(); // Load list
void vList(); // View list
void sList(); // Save list
void dList(); // Delete list
char debug; // For debugging
int main(){
cout << "DEBUG: Start of program..." << endl;
cin >> debug; // This doesn't work?
cout << "Contact Manager..." << endl;
cout << "Input 'h' for help." << endl << endl;
system("PAUSE"); // But this does!
list none;
none.setBlank();
cLine(&none); // Enter commands, pass a blank list
return 0;
}
void cLine(list *noList){
char cBuff; // Input buffer
list *loaded=noList;
do{
cout << ">";cin >> cBuff; /*Read command*/ cout << "\n";
switch (cBuff){ // Evaluate command
case 'h':
case 'H': // Show help
showHelp();
break;
case 'q':
case 'Q': // Quit after confirm, if no, prompt
cout << "\n"
<< "You have chosen to quit. Any unsaved information will"
<< "be lost.\nAre you sure? [y/n]: ";
cin >> cBuff;
if (cBuff=='y'||cBuff=='Y'){ // Only 'y'||'Y' terminates
return;
}
else{ // Anything else aborts termination
cout << "\n"
<< "Quitting aborted...\n";
}
break;
case 'c':
case 'C':
cList();
break;
case 'l':
case 'L':
lList();
break;
case 'i':
case 'I':
vList();
break;
case 's':
case 'S':
sList();
break;
case 'd':
case 'D':
dList();
break;
case 'n': /* There's a better way to do all of these using a member function that */
case 'N': /* checks to see if the loaded list is blank, but I'll use this for now. */
if (loaded->blank==true){
cout << "Please [l]oad a list first.\n";
}
else{
loaded->nCont();
}
break;
case 'e':
case 'E':
if (loaded->blank==true){
cout << "Please [l]oad a list first.\n";
}
else{
loaded->eCont();
}
break;
case 'v':
case 'V':
if (loaded->blank==true){
cout << "Please [l]oad a list first.\n";
}
else{
loaded->vCont();
}
break;
case 't':
case 'T':
if (loaded->blank==true){
cout << "Please [l]oad a list first.\n";
}
else{
loaded->dCont();
}
break;
default:
cout << "Illeagal command. Input 'h' to display help.\n";
break;
}
}
while(true);
return;
}
void showHelp(){ // Display help
cout << "\n"
<< "Issue a command by inputting the coresposnding\n"
<< "letter in brackets.\n"
<< "\n"
<< "[H]elp\n"
<< "[Q]uit\n"
<< "[C]reate New Contact List\n"
<< "[L]oad Contact List\n"
<< "V[i]ew Contact List\n"
<< "[S]ave Contact List\n"
<< "[D]elete Contact List\n"
<< "Create [N]ew Contact\n"
<< "[E]dit Contact\n"
<< "[V]iew Contact\n"
<< "Dele[t]e Contact\n"
<< "\n";
return;
}
void cList(){ // Doesn't actually do anything yet.
string name;
cout << "Input name for list: ";
cin >> name;
cout << "List " << name << "created. Remember to save.\n";
return;
}
void lList(){
return;
}
void vList(){
return;
}
void sList(){
return;
}
void dList(){
return;
}
Hope this is what you guys need.