Append Function

This is a discussion on Append Function within the C++ Programming forums, part of the General Programming Boards category; Helo... I got a small problem here. Is there anyone out there who can solve my problem? I writing a ...

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    7

    Red face Append Function

    Helo...

    I got a small problem here. Is there anyone out there who can solve my problem?
    I writing a program to take out a string from a text file (.txt) and then put this string to another text file.
    While doing this, this string is compared with the second text file, if there's existing string in the second file,
    output error "fail".If there's no same string, put the new string into the text file.

  2. #2
    Registered User
    Join Date
    Jan 2003
    Posts
    7

    Red face Append Function

    Helo...

    I got a small problem here. Is there anyone out there who can solve my problem?
    I writing a program to take out a string from a text file (.txt) and then put this string to another text file.
    While doing this, this string is compared with the second text file, if there's existing string in the second file,
    output error "fail".If there's no same string, put the new string into the text file.

  3. #3
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Yep. I can solve it. But the question is, can you? How about you show us what you have done, and what you're having problems with.

    Quzah.
    Hope is the first step on the road to disappointment.

  4. #4
    Registered User
    Join Date
    Dec 2002
    Posts
    119
    >> Is there anyone out there who can solve my problem?

    There are hundreds of us.

    I suggest you give it a shot and ask questions concerning problems that you have.
    For starters:
    1. read file # 1
    2. read file # 2
    3. compare data
    4. write to file #2 if necessary

    look up ifstream, ofstream and strcmp. (You can do a search on this board.)

    -Futura
    If you speak or are learning Spanish, check out this Spanish and English Dictionary, it is a handy online resource.
    What happens is not as important as how you react to what happens. -Thaddeus Golas

  5. #5
    Registered User Vber's Avatar
    Join Date
    Nov 2002
    Posts
    807

    We'll not write all the source for you..

    You need to show us, what you did?
    Where you're getting in problem?

  6. #6
    Registered User
    Join Date
    Jan 2003
    Posts
    7

    Append Function

    Helo Guys...

    Thanx for your prompt reply.
    I'm a begineer in visual c. I'm using Microsoft Visual C++ program to write and compile my codes.
    Attached is the zip file which i wrote and stuck.
    Explanation:
    File No 1:Info.txt
    File No 2:HDD.txt
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    Jan 2003
    Posts
    7

    Append Function

    Helo Guys...

    Thanx for your prompt reply.
    I'm a begineer in visual c. I'm using Microsoft Visual C++ program to write and compile my codes.
    Attached is the zip file which i wrote and stuck.
    Explanation:
    File No 1:Info.txt
    File No 2:HDD.txt
    Attached Files Attached Files

  8. #8
    Registered User Vber's Avatar
    Join Date
    Nov 2002
    Posts
    807

    Hmm, you got some problems in your code..

    Code:
    void main(int argc, char * argv[])
    Do not use void main() never.
    You should use int main() and than, return an value at the end of the program.

    Why every time you '\0' the string manually?
    You can do it easily by an simple loop:
    Code:
    for(index = 0; index <= 35; index++)
        string[index] = '\0';
    After you fix this errors, we'll work in the real problem

  9. #9
    Registered User
    Join Date
    Jan 2003
    Posts
    7
    Helo VBer...

    Thanx for your prompt reply.
    Attached is the zip file which i have edited according to what u want.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    Jan 2003
    Posts
    7

    Sorry

    Hi .....

    Sorry for posting on two forums just now...did not realize that....

  11. #11
    Registered User
    Join Date
    Jan 2003
    Posts
    7

    Unhappy Append Function

    Hi...

    I have edited to what you want. can teach me how to do the next step? The newest code is attached in the previous replies. Thanx

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  2. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 10:03 PM
  3. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 01:28 PM
  4. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 01:53 AM
  5. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 06:05 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21