Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to create an array of objects?

How to create an array of objects?

Scheduled Pinned Locked Moved C#
graphicsdata-structurestutorialquestionworkspace
12 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N N a v a n e e t h

    Your post is broken and hard to read. Please edit it and make it readable.

    Aghosh Babu wrote:

    i want to create an array of modem objects

    Create a class, say Modem with all required properties and put it in a List<Modem> other than arraylist.

    Navaneeth How to use google | Ask smart questions

    L Offline
    L Offline
    Lost User
    wrote on last edited by
    #3

    +5 for the attempt to read. WTF you going to audit 300 lines of someone else's code???

    N 1 Reply Last reply
    0
    • L Lost User

      +5 for the attempt to read. WTF you going to audit 300 lines of someone else's code???

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #4

      :)

      Navaneeth How to use google | Ask smart questions

      A 1 Reply Last reply
      0
      • N N a v a n e e t h

        :)

        Navaneeth How to use google | Ask smart questions

        A Offline
        A Offline
        Aghosh Babu
        wrote on last edited by
        #5

        :confused::confused:

        A 1 Reply Last reply
        0
        • A Aghosh Babu

          :confused::confused:

          A Offline
          A Offline
          Aghosh Babu
          wrote on last edited by
          #6

          pls tell me how to create an array of objects in general? and how to call the objects later??

          N 1 Reply Last reply
          0
          • A Aghosh Babu

            pls tell me how to create an array of objects in general? and how to call the objects later??

            N Offline
            N Offline
            N a v a n e e t h
            wrote on last edited by
            #7

            Aghosh Babu wrote:

            pls tell me how to create an array of objects

            object[] objArray = {new object(),new object()};

            You access it with an indexer. Like

            object obj1 = objArray[0]

            . These all are basics and looks like you need a C# book. :)

            Navaneeth How to use google | Ask smart questions

            A 1 Reply Last reply
            0
            • N N a v a n e e t h

              Aghosh Babu wrote:

              pls tell me how to create an array of objects

              object[] objArray = {new object(),new object()};

              You access it with an indexer. Like

              object obj1 = objArray[0]

              . These all are basics and looks like you need a C# book. :)

              Navaneeth How to use google | Ask smart questions

              A Offline
              A Offline
              Aghosh Babu
              wrote on last edited by
              #8

              I am not an expert.. this is my univ project! ;P

              J 1 Reply Last reply
              0
              • A Aghosh Babu

                I am not an expert.. this is my univ project! ;P

                J Offline
                J Offline
                J4amieC
                wrote on last edited by
                #9

                Aghosh Babu wrote:

                this is my univ project!

                Then you've learnt nothing, choose another career path.

                A L 2 Replies Last reply
                0
                • J J4amieC

                  Aghosh Babu wrote:

                  this is my univ project!

                  Then you've learnt nothing, choose another career path.

                  A Offline
                  A Offline
                  Aghosh Babu
                  wrote on last edited by
                  #10

                  thanks for the advice! unfortunately i havn't born as a programmer ;P

                  W 1 Reply Last reply
                  0
                  • A Aghosh Babu

                    thanks for the advice! unfortunately i havn't born as a programmer ;P

                    W Offline
                    W Offline
                    wasimsharp
                    wrote on last edited by
                    #11

                    <pre> i am developing an sms gateway application</pre> If ur not programmer then how you develop that gateway. :sigh: But Here is the Solution

                    ArrayList arrObj = new ArrayList();
                    arrObj.Add(YourObject);

                    foreach(object o in arrObj)
                    {
                    if(o is YourObjectClass)
                    {
                    //Use this object
                    }
                    }

                    WANTED wasim khan(Killed 50 Innocent Buggs, Distroyed 200 Exception, make 5 Project Hostage) any Compnay Hire him will pay 30,000. Best place where u can get him is Sorcim Technologies Murre Road RWP

                    1 Reply Last reply
                    0
                    • J J4amieC

                      Aghosh Babu wrote:

                      this is my univ project!

                      Then you've learnt nothing, choose another career path.

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #12

                      If I handed in my University project that composed (mainly) of an array of generic objects I don't think I would have passed.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups