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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:41:35+00:00 2026-06-07T19:41:35+00:00

I am writing a class which holds 90 integer variables. There are basically 10,

  • 0

I am writing a class which holds 90 integer variables. There are basically 10, but each has 3×3 attributes, making them 90. I’ll explain it further.

So the 10 variables I have are: v0, v1, v2, …, v9. Each of these has three different values, for city, county and state. Also, each of these has three different values for past, present and future.

So, a typical value would be: v3.City.Future or v7.State.Past or v8.County.Present.

I was thinking to implement a class, with 10 structs for each variable, then each of those struct has a three nested structs (for city, county and state) and each of those structs has three integer variables for past, present and future.

This is still in the conceptual phase. I tried to go with the above mentioned approach, but it is not working.

Here is the code snippet:

public class MyClass
{
    public MyVariable myvariable;
}

public struct MyVariable
{
    public struct National
    {
        public int Past { get; set; }
        public int Present { get; set; }
        public int Future { get; set; }
    }
    ...
}

Now when I instantiate the class and access the member (myclass.myvariable.National.Past), it does not get the member.

  • 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-07T19:41:37+00:00Added an answer on June 7, 2026 at 7:41 pm

    Here is the answer to this:

    public struct PeriodVars
    {
        public int Past { get; set; }
        public int Present { get; set; }
        public int Future { get; set; }
    }
    
    public struct VarStruct
    {
        public PeriodVars City;
        public PeriodVars County;
        public PeriodVars State;
    }
    

    Now the class will be:

    public class MyClass
    {
        public VarStruct v0;
        public VarStruct v1;
        ...
    }
    

    Once I instantiate an object of the class, I can refer it to like this:

    objMyClass.v0.City.Past = 111;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a template class which takes a floating-point-like type (float, double, decimal,
I am writing unit for a class which looks like following using nunit and
I am writing a Xml Tag Renamer class with Java which reads in a
I am writing a controller class for my plist, which gets called from another
I am writing a custom flex preloader which extends the IPreloaderDisplay class. How can
I've got a method in a class that's writing to some string, which calls
I have been writing several class templates that contain nested iterator classes, for which
I would like to create one class which holds some key values of the
I am trying to persist a large class called an Authorizer which holds a
I'm writing a class that holds a variable of any type. To do so,

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.