Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 504509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:30:15+00:00 2026-05-13T06:30:15+00:00

I have just recently been doing something in C#, i would like to know

  • 0

I have just recently been doing something in C#, i would like to know how to do something like this.

Array[0] =
  Array['Value'] = 2344;
  Array['LocationX'] = 0;
  Array['LocationY'] = 0;
Array[1] =
  Array['Value'] = 2312;
  Array['LocationX'] = 2;
  Array['LocationY'] = 1;
Array[2] =
  Array['Value'] = 2334;
  Array['LocationX'] = 4;
  Array['LocationY'] = 3;

The data it self its not important, the thing is that i know how to do this in PHP. But in C# i don’t, and I’ve tried some ways and no luck.

In PHP i could just do something like this:

$Array[0]->Value = 2344;
$Array[0]->LocationX = 0;
$Array[0]->LocationY = 0;

And those values would be added to the Array.

In C# i’ve tried this and doesn’t work that way.

Could someone enlighten me in how to do this in C#?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:30:15+00:00Added an answer on May 13, 2026 at 6:30 am

    Well, you could have an array of instances of a class that you write like so:

    public class DataForArray
    {
        public int Value { get; set; }
        public int LocationX { get; set; }
        public int LocationY { get; set; }
    }
    

    Then something like this:

    DataForArray[] array = new DataForArray[10];
    array[0] = new DataForArray();
    array[0].Value = 2344;
    etc...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been stuck on this for a day or two, I have recently
I've recently decided that I just have to finally learn C/C++, and there is
I've recently began using dTrace and have noticed just how awesome it is. Its
I am just getting started with Silverlight and have recently added a Silverlight project
Have had to write my first proper multithreaded coded recently, and realised just how
I have been doing a lot of work with WCF self hosted applications. I
In my job project I have recently been asked to generate POM files via
I have recently tried sharpening my rails skills with this tool: http://github.com/edgecase/ruby_koans but I
I've been away from web design/development for a long, long now and have recently
I have recently been using cookie store and I want to transition to active

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.