Ragged Array

This is a discussion on Ragged Array within the C Programming forums, part of the General Programming Boards category; How do we take the inputs for ragged arrays from command line.......??...

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    14

    Ragged Array

    How do we take the inputs for ragged arrays from command line.......??

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    What do you want to do? What sort of input are you expecting on the command line (or are you asking how to describe such an array on a command-line?)

    --
    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
    Mar 2009
    Posts
    14
    Actually a ragged array is a two dimensional array in which the elements in the rows is not same.

    here is a sample input how it should be read
    43.6.9
    90
    45,1,21

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I take it that first line has a typo of some sort, as 43.9.6 is not a valid number, nor a list of valid numbers.

    But yes, I know (after I googled it) what a ragged array is. What I'm asking is what you actually want to know. And more importantly, what it has to do with command-line.

    --
    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
    Mar 2009
    Posts
    14
    yes the first line has a typo its actually 43,6,9...........

    my command line i mean we have to take some input ............in such case we read it........so how do we take inputs for a ragged array

  6. #6
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    fgets + strtol in a loop, I suppose.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 05-29-2009, 07:25 PM
  2. [question]Analyzing data in a two-dimensional array
    By burbose in forum C Programming
    Replies: 2
    Last Post: 06-13-2005, 07:31 AM
  3. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  4. Quick question about SIGSEGV
    By Cikotic in forum C Programming
    Replies: 30
    Last Post: 07-01-2004, 07:48 PM
  5. Array Program
    By emmx in forum C Programming
    Replies: 3
    Last Post: 08-31-2003, 12:44 AM

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