help with a C program

This is a discussion on help with a C program within the C Programming forums, part of the General Programming Boards category; I need to write a C program that recognizes the following commands ONLY using scanf(). -list -cd dir -get file_name ...

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    1

    help with a C program

    I need to write a C program that recognizes the following commands ONLY using scanf().

    -list
    -cd dir
    -get file_name

    Any advice on how to achieve this? Thanks

  2. #2
    ---
    Join Date
    May 2004
    Posts
    1,379
    Step 1-
    Open your text book

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    Step 2 - Post your attempt.

    (Hint: use strncmp(), in <string.h>.)
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

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, 12: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, 12:41 PM
  3. Replies: 4
    Last Post: 02-21-2008, 09:39 AM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM

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