+ Post New Thread
Results 1 to 7 of 7
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 ...
  1. #1

    Join Date
    Apr 2008
    Posts
    4
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Angry 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.

  2. #2

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,778
    Thank Post
    1,469
    Thanked 590 Times in 442 Posts
    Rep Power
    168
    And what made you think of posting here

    Simon

  3. #3

    ZeroHour's Avatar
    Join Date
    Dec 2005
    Location
    Edinburgh, Scotland
    Posts
    5,630
    Thank Post
    890
    Thanked 1,314 Times in 798 Posts
    Blog Entries
    1
    Rep Power
    441
    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.

  4. #4

    Join Date
    Jan 2008
    Posts
    23
    Thank Post
    0
    Thanked 1 Time in 1 Post
    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 ?

  5. Thanks to raufdean from:

    greguk (2nd April 2008)

  6. #5

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,778
    Thank Post
    1,469
    Thanked 590 Times in 442 Posts
    Rep Power
    168
    Why not?
    We're not an after school ELC are we

    Its a 1st post and the question isn't even sensible - i suspect spam bot type program.

    Mind you last time I accused someone of that they went ballistic

    regards

    Simon

    Mind you - full credit to it - I've been trolled into 2 posts

  7. #6

    Join Date
    Apr 2008
    Posts
    4
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Smile 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.

  8. #7


    tom_newton's Avatar
    Join Date
    Sep 2006
    Location
    Leeds
    Posts
    4,461
    Thank Post
    866
    Thanked 845 Times in 667 Posts
    Rep Power
    195
    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:
+ Post New Thread

Similar Threads

  1. AUP logon acceptance program
    By mark in forum Downloads
    Replies: 10
    Last Post: 12th May 2010, 08:15 PM
  2. text to speech program
    By strawberry in forum Educational Software
    Replies: 5
    Last Post: 27th January 2010, 01:16 PM
  3. Program security.
    By boomam in forum How do you do....it?
    Replies: 7
    Last Post: 24th January 2008, 08:46 AM
  4. cli consul program needed
    By edie209 in forum Wireless Networks
    Replies: 3
    Last Post: 26th July 2006, 05:38 PM
  5. advice needed on weather a new server is needed
    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
  •