Jagged array program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ASIM ABBAS
    New Member
    • Oct 2008
    • 10

    Jagged array program

    Sir plz explain and also send me the code of dynamic jagged array
    i make static jagged array
    but how we make dynamic jagged array
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    Originally posted by Original Poster
    Can anybody send me code to [...]
    The Bytes volunteers are not here to write your code for you. This is not a free homework service.
    Bytes is very much a "Give me a fish I eat for a day. Teach me to fish I eat for a lifetime" kind of place. Just giving you the code doesn't help you learn near as effectively as good old-fashioned trial and error.

    Please research your problem before posting your question.
    A great place start your research is the MSDN library. This library is a bunch of articles and documentation provided by Microsoft about anything to do with .NET development. I recommend that you bookmark the resource for your future reference.

    After you research, do some experimenting. Then if your trials aren't doing what you expect, post the code and relevant messages/errors and we'll see what we can do to point you in the right direction for making it work.

    Try hitting Google with terms of your programming language and primary terms of what you want to do. For example "C# custom events" or "VB datagrid Excel". I've found this to be a very effective tool.
    Please visit the Posting Guidelines for tips on how to ask questions to get the best help.

    Comment

    • artov
      New Member
      • Jul 2008
      • 40

      #3
      I know, I am not allowed to answer these "solve my home work" questions, but..

      What do you mean by "static jagged array"? To me, jagged array is an (one dimensional) array, that has arrays as its elements. The element arrays can have different dimensions (i.e. they are jagged). How can you statically decide the jaggedness? Aren't each element created as needed, i.e. dynamically?

      Comment

      • tlhintoq
        Recognized Expert Specialist
        • Mar 2008
        • 3532

        #4
        An address book entry?
        Element 1: person
        sub 1: firstname
        sub 2: last name
        Element 2: address
        sub 1: street
        sub 2: city
        sub 3: state
        sub 4: zip code

        You know in advance that every name is 2 elements long and every address is 4 elements long.

        Not a good way in my opinion - but it doesn't take too much imagination to see how someone might make a jagged array of fixed element count.

        Comment

        • jkmyoung
          Recognized Expert Top Contributor
          • Mar 2006
          • 2057

          #5
          True, most of the time instead of having a jagged 2-dimensional array, it pays to build a subclass with a single dimensional array, and have an array of the subclass.

          Is there a real purpose to this exercise, or is it for strictly academic purposes?

          Comment

          • ASIM ABBAS
            New Member
            • Oct 2008
            • 10

            #6
            Originally posted by artov
            I know, I am not allowed to answer these "solve my home work" questions, but..

            What do you mean by "static jagged array"? To me, jagged array is an (one dimensional) array, that has arrays as its elements. The element arrays can have different dimensions (i.e. they are jagged). How can you statically decide the jaggedness? Aren't each element created as needed, i.e. dynamically?
            sir static array means that i give value in array in design time ?what the method to give value in run time in jagged array

            Comment

            • ASIM ABBAS
              New Member
              • Oct 2008
              • 10

              #7
              Originally posted by jkmyoung
              True, most of the time instead of having a jagged 2-dimensional array, it pays to build a subclass with a single dimensional array, and have an array of the subclass.

              Is there a real purpose to this exercise, or is it for strictly academic purposes?
              sir for real purpose

              Comment

              • jkmyoung
                Recognized Expert Top Contributor
                • Mar 2006
                • 2057

                #8
                I stick with my original response: have a subclass with an array, unless there is a real, compelling reason to do otherwise. I have seen no such reason thus far.
                Otherwise, could you post how you're creating your static array, and show an example of how you would like to create your dynamic array?

                Comment

                Working...