Thread: Command Line Argument problem

  1. #1
    Registered User
    Join Date
    Apr 2004

    Command Line Argument problem

    This is an assignment problem. It uses dynamic memory & the qsort function in the standard C library. The program is called csort

    Anyways, I dont understand this detail:

    it says "csort must be invoked with exactley one (other) command line argument. That argument consists of a sequence of integers seperated by commas.

    I dont fully understand what is meant by this.
    How can you have one command line argument that consists of a sequence of integers?

    Maybe i'm not thinking about it the right way.....

    I couldn't get in touch with the teacher yet to explain it a bit more.
    But i think you guys know what it's talking about.....

    this is what i came up with......correct me if i'm wrong

    argv[0] = csort
    argv[1] = 4, 2 /* for example */

    so i would need to check argv[1] digit by digit?

    Last edited by dredre; 04-29-2004 at 01:00 AM.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    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.

  3. #3
    Registered User
    Join Date
    Apr 2004
    Quote Originally Posted by Salem
    Damn, if i would of joined sooner, my previous assignment would of been so much easier.

    That's exactley what we had to check for in the command line.

    btw, thanks for the quick response

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. class as argument problem
    By hallo007 in forum C++ Programming
    Replies: 2
    Last Post: 05-20-2007, 05:23 AM
  2. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  3. ListView_SetItemText argument problem
    By Scarvenger in forum Windows Programming
    Replies: 3
    Last Post: 08-30-2006, 10:52 AM
  4. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM
  5. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 08:37 AM