Beginner’s help

Home Forums C Programming Beginner’s help

This topic contains 1 reply, has 2 voices, and was last updated by  Humayan 10 years, 2 months ago.

  • Author
    Posts
  • #2084

    Ms.R
    Member

    I am new to C, literally. My lovely professor wants us to teach ourselves to program while he compiles it and tells us we’re wrong without going into any details. If it compiles and it runs = A, if it doesn’t = F. There’s no inbetween. By the way, this is to be compiled using “gcc” in an UNIX environment

    part a:
    First of all, you are supposed to write a program in either C or C++ that reads data from a file and copies it to another file. Your program should copy all contents of the file.

    part b:
    Secondly, write another program to create child processes from your main program recursively using fork( ) and exec( ) commands up to a certain level, for example, fifth level. Then print identification of each child process in each level.

    My code:
    Part A:Code:

    Please helpe me?!!?! What am I doing wrong? What am I missing? This guy told me it’d be easy because I “know” Java and it isn’t. I honestly think learning Ada was a lot easier than C.

  • #3370

    Humayan
    Member

    For the first part you could do:
     

You must be logged in to reply to this topic.