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

  • Home
  • SEARCH
  • 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 97523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:01:16+00:00 2026-05-11T00:01:16+00:00

In C# language when you refer to an array element you can write: myclass.my_array[‘element_name’]

  • 0

In C# language when you refer to an array element you can write:

myclass.my_array[‘element_name’] = new Point(1,1);

I think about refering to a element with name element_name by using dot in place of backets:

myclass.my_array.element_name = new Point(1,1);

Do you know any language where exists similar syntax to the example above?

What do you think about this example of refering to a array element? Is this good or is it as bad as my writing in english skills?

Kind regards

  • 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. 2026-05-11T00:01:17+00:00Added an answer on May 11, 2026 at 12:01 am

    You could almost certainly do this in any dynamic language, by handling property/variable access as an indexer if the specified property/variable didn’t actually exist. I suspect that many dynamic languages already provide this functionality in some areas.

    It’s possible that in C# 4 you’ll be able to make your objects behave like this if you really want to.

    However, I would agree with the implicit judgement in Mohit’s question – I see no reason to consider this more generally readable than using the more common indexer syntax, and it will confuse people who are used to indexers looking like indexers.

    One area where I would quite possibly do something like this would be for an XML API, where a property would indicate ‘take the first element of the given name’:

    XElement author = doc.Root.Posts.Author; 

    That’s quite neat – for the specific cases where it’s what you want. Just don’t try to apply it too generally…

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

Sidebar

Ask A Question

Stats

  • Questions 73k
  • Answers 73k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer ActionScript has both event bubbling and event capturing. This means… May 11, 2026 at 2:05 pm
  • added an answer As craig said, this is an issue in the dev… May 11, 2026 at 2:05 pm
  • added an answer I found this answer to the question on jGuru written… May 11, 2026 at 2:05 pm

Related Questions

In C# language when you refer to an array element you can write: myclass.my_array['element_name']
How can I detect keyboard event in C language without using third party libraries?
Which would be a neat implemenation of a N-ary tree in C language? Particulary,
What database should a beginner use in the C language? Can I use MySQL?
An example of unspecified behavior in the C language is the order of evaluation
I've seen some very good questions on Stack Overflow concerning delegates, events, and the
I'm working on a web project that will (hopefully) be available in several languages
I'm designing a high level language, and I want it to have the speed
At my old C++ job, we always took great care in encapsulating member variables,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.