Coding Thread, Help with C++ program needed in Coding and Web Development; I have a program for my assignment but I'm struggling with reading/writting to file. If anyone can help I'll be ...
-
2nd April 2008, 06:25 PM #1
- Rep Power
- 0
Help with C++ program needed
I have a program for my assignment but I'm struggling with reading/writting to file. If anyone can help I'll be more than happy.
if(!ReadRecords("C:\\PDI\\Quotes.txt",Quotes, NumRecords))
{
cout << "Failed to find file quotes.txt";
}
else
{
do
{
system ("CLS");
if(i==0)
Quote.QuoteNum =INITIAL_QUOTE_NUMBER;
else
Quote.QuoteNum =Quotes[NumRecords-1].QuoteNum+1;
Quotes[NumRecords]=GetQuote(Quote);
NumRecords++;
cout << "\n\nEnter another quote?";
cin >> AnotherQuote;
} while(AnotherQuote=='Y'||AnotherQuote=='y');
file exist on disk in that location.
-
-
IDG Tech News
-
2nd April 2008, 07:18 PM #2 And what made you think of posting here 
Simon
-
-
2nd April 2008, 08:01 PM #3 Why not?
You never know who has c++ experience. I am more a c#/php sorta person myself so I doubt I am much help.
-
-
2nd April 2008, 08:52 PM #4
- Rep Power
- 0
I've been writing c++ for about 12 years...
I'd help you but I'm not sure what the question is ?
-
-
2nd April 2008, 09:07 PM #5
-
-
2nd April 2008, 11:13 PM #6
- Rep Power
- 0
spam program?heh
I'm not a spam program. Maybe i didn't precise question right but i just want to have general outlook if anyone have any C++ experience to help me. i didn't want to post my entire program.
My program have to read data from file, store them and add new records to the end of this file.
-
-
3rd April 2008, 08:20 AM #7 Greg,
You've not given us enough information - at least not in the right places. There are a bunch of function calls in there - ReadRecords() for example, which aren't standard, so we have no idea how they work. Ditto your object/struct "Quote", and as for the variable "i" - where is it set, and what significance has it?
I would suggest you start again, and do very, very small bits at a time, testing weach stage thoroughly as you go, Whatever you do, ALWAYS write ecvery line yourself. Don't cut and paste bits of other similar code and expect to tweakl them, or you won't gain the understanding, and when it breaks, you're boned.
Don't think anyone's going to write this for you, but I for one would be happy to answer any specific C/C++-y questions, though its been a few years since i had my hackers' hat on!!
-
SHARE: 
Similar Threads
-
By mark in forum Downloads
Replies: 10
Last Post: 12th May 2010, 08:15 PM
-
By strawberry in forum Educational Software
Replies: 5
Last Post: 27th January 2010, 01:16 PM
-
By boomam in forum How do you do....it?
Replies: 7
Last Post: 24th January 2008, 08:46 AM
-
By edie209 in forum Wireless Networks
Replies: 3
Last Post: 26th July 2006, 05:38 PM
-
By projector1 in forum Hardware
Replies: 3
Last Post: 24th February 2006, 09:20 AM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules