Command line arguments

This is a discussion on Command line arguments within the C Programming forums, part of the General Programming Boards category; int main(int arg, char** argc) what does ** mean ? why my program crash if I replace it with char* ...

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    85

    Command line arguments

    int main(int arg, char** argc)

    what does ** mean ?
    why my program crash if I replace it with char* argc ?

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    char** is a pointer to a pointer. To save me explaining, do some web searching, or check your book (if you have one).

    Here's a starter for you. It explains about command line arg usage.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Registered User
    Join Date
    Jul 2002
    Posts
    85
    thanks

    which is faster for a large data?
    a pointer to pointer is better or a pointer to array?
    Last edited by Kelvin; 07-12-2002 at 07:22 AM.

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >which is faster for a large data?
    It really depends on the data. If you have a set of strings which vary wildly in length then a pointer to a pointer or an array of pointers to char will be more space efficient. Usually when it comes to arrays, space is more of a concern than speed.

    -Prelude
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginner Needs help in Dev-C++
    By Korrupt Lawz in forum C++ Programming
    Replies: 20
    Last Post: 09-28-2010, 02:17 AM
  2. GradeInfo
    By kirksson in forum C Programming
    Replies: 23
    Last Post: 07-16-2008, 04:27 PM
  3. command line arguments
    By vurentjie in forum C Programming
    Replies: 3
    Last Post: 06-22-2008, 07:46 AM
  4. Replies: 10
    Last Post: 09-27-2005, 01:49 PM
  5. NULL arguments in a shell program
    By gregulator in forum C Programming
    Replies: 4
    Last Post: 04-15-2004, 11:48 AM

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