Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Apr 25th, 2005, 9:05 PM   #1
brokenhope
Hobbyist Programmer
 
Join Date: Apr 2005
Posts: 126
Rep Power: 4 brokenhope is on a distinguished road
Making a Note Adder/ Editor/ Deleter/ Viewer thingy

Well the title explains it, im just making this to practice a few things ive learned. Im not sure how I will be able to do the editor or deleter, seems like it will be very hard, but ill deal with it when I come to it. Basicaly this stores everything to a .txt file and the program manipulates it.

First thing im having trouble with is making a while loop that never ends, since this will be the menu it will always be refrered back to when your done with the function...

#include <iostream.h>
#include <stdlib.h>
#include <fstream.h>

// Variables
char choice1;
char choice2;
// Functions
void mainMenu();
void addNote();
void delNote();
void edtNote();
void viwNote();
using namespace std;

int main()
{
    mainMenu();
    system("PAUSE");
    return 0;
}

void mainMenu()
{
    while (choice1) {
    cout << "Main Menu/n1. Add Note/n2. Delete Note/n3. Edit Note/n4. View Notes\n\nOption: ";
    cin >> choice1;

         switch ( choice1 ) {
              case  '1':
              addNote();
              break;
              case '2':
              delNote();
              break;
              case '3':
              edtNote();
              break;
              case '4':
              viwNote();
         }
    }
}

void addNote() {
}
void delNote() {
}
void edtNote() {
}
void viwNote() {
}

I wanted to use gets() to get the input but it wouldnt work at all, so im stuck with cin. Anyways back to the loop I was trying to use while(choice1) { to work as long as choice1 exists but that doesnt work, it starts off as null, and sometimes it will be valueless, so im not even gonna try to make a piece of crap to get that to work, any ideas?
brokenhope is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You m