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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:55:33+00:00 2026-05-18T06:55:33+00:00

I come from a C++ background, so apologies if this is a non-C# way

  • 0

I come from a C++ background, so apologies if this is a non-C# way of thinking, but I just need to know. 🙂

In C++ if I have two pointers, and I want to know if they point to the same thing, I can look in the memory/watch window and see their value – to see if they are pointing to the same memory space.

In C#, I haven’t been able to find something along those lines. One reference type with exactly the same values could in fact be the exact same object, or it could be something wildly different.

Is there a way for me to see this kind of information in C#? Perhaps some kind of equivalent to the & operator for the watch window or some such?

  • 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-18T06:55:33+00:00Added an answer on May 18, 2026 at 6:55 am

    What you’re looking for are object id’s. For any referenc type in the debugger you can right click and say “Make Object ID”. This will add a # suffix to the value column whenever that instance is displayed in the debugger. You can also add #1, #2, etc … to the watch window to see them again any time later.

    Step 0 – Run this code

    static void Main(string[] args)
    {
        var x = "a string";
        var y = x;
        System.Diagnostics.Debugger.Break();
    }
    

    Step 1 – Right Click and select “Make Object Id”

    alt text

    Step 2 – Instances now display with the 1# suffix. Note: I did nothing special in this step. Immediately after clicking “Make Object Id” both rows updated to display the 1# suffix since they refer to the same instance.

    alt text

    Step 3 – See them at any time by adding 1# to the watch window

    alt text

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

Sidebar

Related Questions

I come from Java Background and so used to Debugging using Eclipse but have
I come from more of an Android development background so apologies if this is
I come from a C# background but we have an app that is written
What's the best way to print a BitmapImage? I come from a background in
I come from a java background. But I would like a cross-platform perspective on
I come from Java background, where we have data structures with interfaces that if
I come from frontend background, so I apologize if this db question seems dumb.
I come from a PHP background and would like to know if there's a
I come from a web background where I only have to deal with HTTP
I come from MySQL background and I am trying to learn MongoDB. I have

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.