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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:31:34+00:00 2026-05-19T04:31:34+00:00

Any good site or explanation on what is a ref class and when to

  • 0

Any good site or explanation on what is a ref class and when to declare a class to be a "ref class"?

The explanation on msdn wasn’t enough for me,

base_type(optional)

A base type. A ref class or ref struct can inherit from zero or more managed interfaces and zero or one ref types. A value class or value struct can only inherit from zero or more managed interfaces.

ref

The ref keyword tells the compiler that the class or structure will be allocated on the heap and a reference to it will be passed to functions or stored in class members. The value keyword tells the compiler that all of the data in the class or structure is passed to functions or stored in members.

  • 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-19T04:31:35+00:00Added an answer on May 19, 2026 at 4:31 am

    Basically, a ref class is a CLR class. It’s the equivalent of class in C#.

    This creates a reference type managed by the CLR. If you want to make a class that’s usable from C#, you’d normally create a ref class. (ref struct, by the way, does exactly the same thing, but with C++’s standard class vs. struct default accessibility rules.)

    Also, just for reference – in order to make a value type (struct in C#), you’d use value class or value struct.

    A good explanation of many of these new keywords is Herb Sutter’s post on C++/CLI Keywords. This is a useful reference if you’re new to C++/CLI, but have a solid C++ background.

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

Sidebar

Related Questions

do you have any good suggestions how to backup remote php site and mysql,
I can't find any good explanation of how to use git to get a
Are there any good ASP.NET site templates out there? I am looking for something
any good recommendations for databinding. i am starting to look into WPF more and
DOes anyone have any good information with regards to when to log, I was
Does anyone know any good resources with tasks or problems to get practice in
Are there any good technical solutions for extremely long term archiving of data, for
Are there any good examples of mvc routing wherein every 404 page not found
Are there any good open source frameworks for developing computer system emulators? I am
Is there any good way of truncating text with plain HTML and CSS, 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.