Ragged array

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ranjitshs
    New Member
    • Mar 2009
    • 6

    Ragged array

    How can we implement ragged array for integers in c
  • newb16
    Contributor
    • Jul 2008
    • 687

    #2
    It is a question?

    Code:
    int**arr = (int**)malloc(N*sizeof(int*));
    for(i=0;i<N;i++)
      arr[i]=(int*)malloc(M*sizeof(int));

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      I think you may be needing a chain-link table.

      This is explained in Sedgewick's Algorithm's in C++.

      Comment

      Working...