Need C Help :(

This is a discussion on Need C Help :( within the C Programming forums, part of the General Programming Boards category; I was working on a C program command interpreter where I have to deal with fork and other commands. I ...

  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    5

    Need C Help :(

    I was working on a C program command interpreter where I have to deal with fork and other commands.
    I wrote the program and also initiated the run command in it.
    Now I am not being able to initiate a copy function in it.
    So, please help me with this.
    I have attached my source file.
    If possible, could you make it work?

    here is what I need to do?
    COPY command takes two additional arguments, the source(file to be copied) and the destination(file to be created).
    The syntax is
    COPY source destination

    Algorithm is:
    Open the source file for input
    Open the destination file for output
    For each character in the source file
    Read the character from the source
    Write the character to destination
    Close the source file
    Close the destination file.
    Attached Files Attached Files

  2. #2
    -bleh-
    Join Date
    Aug 2010
    Location
    somewhere in this universe
    Posts
    455
    You'll have better luck posting the code with a codetag. And noone here will write any code for you. You have to write your own code, and we will help you correct it.
    Last edited by nimitzhunter; 04-10-2011 at 03:05 PM.
    "All that we see or seem
    Is but a dream within a dream." - Poe

  3. #3
    Registered User
    Join Date
    Apr 2011
    Posts
    5
    What is a codetag?

    Also I really have no clue on how to get started with the copy function.
    Any suggestions?

  4. #4
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    I guessed you missed this in your zeal... << !! Posting Code? Read this First !! >>

    I had a look at your file... It's C++ code, all jammed up on one line without a linebreak in sight.

    So... you probably should read the link above then repost this in the C++ forum.

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,659
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

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