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 8319971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:29:51+00:00 2026-06-08T22:29:51+00:00

Array of Pairs <string, unsigned long> Array has constant number of elements( 8 ).

  • 0

Array of Pairs <string, unsigned long>

  • Array has constant number of elements(8).

  • Fields string filled (not null, PRIMARY KEY), and never change its values.

  • Fields unsigned long filled with null by default, then change its values in runtime.

  • There will be a lot of such objects.

  • 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-06-08T22:29:54+00:00Added an answer on June 8, 2026 at 10:29 pm

    Wild guess…

    public class MyData
    {
        private Dictionary<string, ulong> _prop1=new Dictionary<string, ulong>(8);
    
        public Dictionary<string, ulong> Prop1
        {
            get { return _prop1; }
            set { _prop1 = value; }
        }
    
        public string CityName { get; set; }
    
        public ulong? Population { get; set; }
    }
    

    And for the a lot of this:

    var alotofobject s= new List<MyData>();
    

    Edit:

    Allright, now I see what you need:

    var cities=new Dictionary<string,ulong>(8);
    cities.Add("City1",0);
    cities.Add("City2",0);
    cities.Add("City3",0);
    cities.Add("City4",0);
    cities.Add("City5",0);
    cities.Add("City6",0);
    cities.Add("City7",0);
    cities.Add("City8",0);
    

    If you want to set or get the population of a city, just use:

    cities["City1"]=293238;
    
    var populationOfCity1=cities["City1"];
    

    And as a suggestion, please get a beginner book for C#.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a string to store key=value pairs, it has same format as
The problem is I have an array that has the key value pairs as
Say I have an array of key/value pairs in PHP: array( 'foo' => 'bar',
I have an array of user inputs ($atts) as key=>value pairs. Some of the
How can I add key value pairs to an array? This won't work: public
Is it possible to prepend an associative array with literal key=>value pairs? I know
I put a string array elements is a map where elements of string array
I want to pass an array of key-value pairs as an argument to a
I am trying to split a string into an array of word pairs in
This is a pretty complex regular expression that returns an array of key/value pairs

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.