Command Line Argument problem

This is a discussion on Command Line Argument problem within the C Programming forums, part of the General Programming Boards category; This is an assignment problem. It uses dynamic memory & the qsort function in the standard C library. The program ...

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    9

    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 02:00 AM.

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

  3. #3
    Registered User
    Join Date
    Apr 2004
    Posts
    9
    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, 06:23 AM
  2. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 07:54 PM
  3. ListView_SetItemText argument problem
    By Scarvenger in forum Windows Programming
    Replies: 3
    Last Post: 08-30-2006, 11: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, 09:37 AM

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