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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:43:42+00:00 2026-05-13T05:43:42+00:00

How does a developer do the equivalent of this in managed c++? : c#

  • 0

How does a developer do the equivalent of this in managed c++? :

c# code

public String SomeValue
{
  get;
  set;
}

I’ve scoured the net and found some solutions, however it is hard to distinguish which is the correct (latest, .NET 3.5) way, given the colourful history of getters/setters and managed 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-13T05:43:42+00:00Added an answer on May 13, 2026 at 5:43 am

    Managed C++ does not support automatic properties. You should manually declare a backing field and the accessors:

    private: String* _internalSomeValue;
    public:
    __property String* get_SomeValue() { return _internalSomeValue; }
    __property void set_SomeValue(String *value) { _internalSomeValue = value; }
    

    C++/CLI supports automatic properties with a very simple syntax:

    public: property String^ SomeValue;
    

    Update (reply to comment):

    In C++/CLI, you cannot control the accessibility of each accessor method separately when you use the automatic property syntax. You need to define the backing field and the methods yourself:

    private: String^ field;
    property String^ SomeValue { 
       public: String^ get() { return field; }
       private: void set(String^ value) { field = value; }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From the Mozilla Developer Network : [1,4,9].map(Math.sqrt) will yield: [1,2,3] Why then does this:
let's say that RoR development environment is set up and working does the developer
In this link it says it does: http://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/MultimediaPG/UsingAudio/UsingAudio.html However I have searched for an
I'm using Visual Web Developer 2010 Express on my laptop to run some ASP.Net
Does anyone know what end user information a developer receives from Apple regarding a
Does anyone know of an alternative to the Internet Developer Toolbar for IE7 that
Does anyone have any experience that indicates what kind of performance hit a developer
Does it matter to developers that the current, and newer versions of .Net don't
Does attempting to develop some sort of game, even just as a hobby during
I just noticed that say http://s7.addthis.com/js/250/addthis_widget.js#pub=PUBID does the equivalent of http://s7.addthis.com/js/250/addthis_widget.js?pub=fct-250 but is much

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.