Help with a program in C.

This is a discussion on Help with a program in C. within the Linux Programming forums, part of the Platform Specific Boards category; Hello! I'm new to this forum. I really suck at C/C++ and I was wondering if anyone can help me ...

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    3

    Help with a program in C.

    Hello! I'm new to this forum.

    I really suck at C/C++ and I was wondering if anyone can help me with a program.

    Write a program in C which will print a menu so the user can choose if he wants to print the contents of a file, calculate the size(using lseek) of the file or delete the said file. Then it will ask from the user the name of the file he wants those actions performed on. Each action will be executed by a child that the father creates.

    If somebody can help me with that program, I'd be indebted to them. Also, if possible, write a comment next to each command so I can understand what it does. The point is for me to understand the program.

    Thank you, and I'll be waiting.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    So what part of that have you done, and which haven't you done.

    I could probably write that (except I haven't got Linux machine to test on), but I would probably also do it in a style that would be unacceptable to your teacher [because I'm devious that way].

    If you check out: Our Homework Policy, then you'll see that you are not supposed to get a "ready written application", you need to do that yourself.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    3
    I've checked out the homework policy. Sorry!

    Can you give me the correct syntax of the lseek command then? And which command deletes a file?

    Thanks!

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    How about you type "man lseek" either at the command prompt, or in a google search? Deleting a file can be done with the very imaginatively named command zaasha, sorry that was the "zoom antia-aliased shared hierarchical ALL" function - I mean, remove(). Again, "man remove" will tell you how to use that.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Registered User
    Join Date
    Nov 2008
    Posts
    3
    Thanks, Mats. I appreciate it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Issue with program that's calling a function and has a loop
    By tigerfansince84 in forum C++ Programming
    Replies: 9
    Last Post: 11-12-2008, 01:38 PM
  2. Need help with a program, theres something in it for you
    By engstudent363 in forum C Programming
    Replies: 1
    Last Post: 02-29-2008, 01:41 PM
  3. Replies: 4
    Last Post: 02-21-2008, 10:39 AM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 11:04 PM

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