| | |
Help on begginer project
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
Hi guys, right now I am an amateur in the world of programming and am starting to "train" myself by thinking of ideas for a program and figuring out how to write it.
So right now, my first real undertaking I have devised is to write an itemizer where the user can create different categories and place items in each category to keep track of different things.
Here is my code so far which is pretty self explanatory. Not all the cases are filled yet, and int cho is considered the menu option that the user inputs. int cho("choice") =D
consider this thread to be a CVS of sorts =)
So I am looking for advice on how to piece this all together. I am not aware of all the techniques and different functions that I can use to accomplish this feat which is why I am looking for guidance and help. Thank you very much in advance for any knowledge or solutions you have to offer me.
If their are any unclear parts of the code please ask me!
Please note that I am trying to keep my code in c++ syntax.
So right now, my first real undertaking I have devised is to write an itemizer where the user can create different categories and place items in each category to keep track of different things.
Here is my code so far which is pretty self explanatory. Not all the cases are filled yet, and int cho is considered the menu option that the user inputs. int cho("choice") =D
consider this thread to be a CVS of sorts =)
c++ Syntax (Toggle Plain Text)
#include <iostream> #include <fstream> #include <windows.h> using namespace std; /* Name: Copyright: Author: Date: 12/11/08 19:42 Description: */ int main() { cout<<"\n\n\n\n"; cout<<"\t1: View Catagory"<<endl; cout<<"\t2: Append new item"<<endl; cout<<"\t3: Truncate an item"<<endl; cout<<"\t4: Create Catagory"<<endl; cout<<"\t5: Delete Catagory"<<endl; do { int cho; bool repeat(false); cout<<">>"; cin>>cho; switch (cho) { case 1: Clist.open(); cout<<Clist; cout<<"What catagory would you like to view?"; case 2: case 3: case 4: int name; cout<<"Title>>"; cin>>name; ofstream Clist ("Catagorylist.txt", ios::app); Clist<<name; Clist.close(); break; case 5: default: cout<<"Bad user input, please select a menu option"; repeat(true); } } while (repeat);
So I am looking for advice on how to piece this all together. I am not aware of all the techniques and different functions that I can use to accomplish this feat which is why I am looking for guidance and help. Thank you very much in advance for any knowledge or solutions you have to offer me.
If their are any unclear parts of the code please ask me!
Please note that I am trying to keep my code in c++ syntax.
Last edited by clutchkiller; Nov 13th, 2008 at 12:09 am.
>That confuses me =(
Get used to it. Good programmers are in a constant state of confusion.
>Looks like i have some quasi specifics to investigate! Up Up And AWAY!
Get used to it. Good programmers are in a constant state of confusion.
>Looks like i have some quasi specifics to investigate! Up Up And AWAY!
Where is Clist defined , is it your code ?
Well im trying to create a clist to write to txt files using the <fstream> header to store peoples categories and items that they decide to create so that they can look them up later or add to them.
>That confuses me =(
Get used to it. Good programmers are in a constant state of confusion.
>Looks like i have some quasi specifics to investigate! Up Up And AWAY!
Get used to it. Good programmers are in a constant state of confusion.
>Looks like i have some quasi specifics to investigate! Up Up And AWAY!
A few tips:
in case 1:
you're using the variable Clist which isn't declared yet. (you're declaring it in case 4)
This:
is not the way to view a text-file. Here's a tutorial.
You should always check if opening your file succeeded, before trying to read or write.
And a few other things, but fix these first.
And now for the most important tip: Bumping threads is very impolite and you're very lucky I'm in such a good mood...
in case 1:
you're using the variable Clist which isn't declared yet. (you're declaring it in case 4)
This:
C++ Syntax (Toggle Plain Text)
Clist.open(); cout<<Clist;
You should always check if opening your file succeeded, before trying to read or write.
And a few other things, but fix these first.
And now for the most important tip: Bumping threads is very impolite and you're very lucky I'm in such a good mood...
Last edited by niek_e; Nov 13th, 2008 at 9:08 am.
![]() |
Similar Threads
- Unresolved External Help (C++)
- Projectile, factorial,fibonacci!!! can you people help us!!! (Visual Basic 4 / 5 / 6)
- turning userinput into a text file (C)
- I Need Help With this Project (Visual Basic 4 / 5 / 6)
- TASM Begginer (Assembly)
Other Threads in the C++ Forum
- Previous Thread: concurrent access issue
- Next Thread: Error with getDate function
| Thread Tools | Search this Thread |
api array beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion count data database delete desktop developer directshow dll download dynamic email encryption error file forms fstream function functions game getline google graph gui homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text text-file tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






