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. object reference not set to an instance of an object

object reference not set to an instance of an object

Scheduled Pinned Locked Moved C#
helpdata-structures
5 Posts 3 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.
  • A Offline
    A Offline
    a fatemeh
    wrote on last edited by
    #1

    Hi every one , It's really get's on my nerve :(( ,I didn't get the problem with my code,please help.

    Int32 i = Convert.ToInt32(lblmnum.Text);
    Int32 j = Convert.ToInt32(lbljnum.Text);
    Process[i][j] = Convert.ToInt32(txttimep.Text);

    and I define the array before :

    int[][] Process= new int[100][];

    thank you all in advance

    M B 2 Replies Last reply
    0
    • A a fatemeh

      Hi every one , It's really get's on my nerve :(( ,I didn't get the problem with my code,please help.

      Int32 i = Convert.ToInt32(lblmnum.Text);
      Int32 j = Convert.ToInt32(lbljnum.Text);
      Process[i][j] = Convert.ToInt32(txttimep.Text);

      and I define the array before :

      int[][] Process= new int[100][];

      thank you all in advance

      M Offline
      M Offline
      Manfred Rudolf Bihy
      wrote on last edited by
      #2

      It looks like the second dimension of your int32 array isn't defined, so what do you expect? A two dimensional array is an array of arrays. You've declared an array with a hundred slots containing arrays with an unspecified array length. Regards, Manfred

      "With sufficient thrust, pigs fly just fine."

      Ross Callon, The Twelve Networking Truths, RFC1925

      "Der Berg ruft!"

      Me, 2012-05-24

      A 1 Reply Last reply
      0
      • M Manfred Rudolf Bihy

        It looks like the second dimension of your int32 array isn't defined, so what do you expect? A two dimensional array is an array of arrays. You've declared an array with a hundred slots containing arrays with an unspecified array length. Regards, Manfred

        "With sufficient thrust, pigs fly just fine."

        Ross Callon, The Twelve Networking Truths, RFC1925

        "Der Berg ruft!"

        Me, 2012-05-24

        A Offline
        A Offline
        a fatemeh
        wrote on last edited by
        #3

        thank you so much,I'm new in c#. at first I try to define it as simple as c. :-D it works thanks.

        M 1 Reply Last reply
        0
        • A a fatemeh

          Hi every one , It's really get's on my nerve :(( ,I didn't get the problem with my code,please help.

          Int32 i = Convert.ToInt32(lblmnum.Text);
          Int32 j = Convert.ToInt32(lbljnum.Text);
          Process[i][j] = Convert.ToInt32(txttimep.Text);

          and I define the array before :

          int[][] Process= new int[100][];

          thank you all in advance

          B Offline
          B Offline
          bishu_Visu
          wrote on last edited by
          #4

          Try This and then use

          Initialize array
          Int32[,] Process = new Int32[5,5];

          Int32 i = Convert.ToInt32("1");
          Int32 j = Convert.ToInt32("1");
          Process[i,j] = Convert.ToInt32("45");

          1 Reply Last reply
          0
          • A a fatemeh

            thank you so much,I'm new in c#. at first I try to define it as simple as c. :-D it works thanks.

            M Offline
            M Offline
            Manfred Rudolf Bihy
            wrote on last edited by
            #5

            You're welcome!

            "With sufficient thrust, pigs fly just fine."

            Ross Callon, The Twelve Networking Truths, RFC1925

            "Der Berg ruft!"

            Me, 2012-05-24

            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