© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
12 replies
Pacrombie

❔ C# Fundamental: does setting one object to another point or copy?

public SomeType someObject = new SomeType();
public SomeType anotherObject = someObject;
public SomeType someObject = new SomeType();
public SomeType anotherObject = someObject;


this is probably a braindead question but in this code, is
anotherObject
anotherObject
"pointing" to
someObject
someObject
(changing the instance variables of one will change the other's) or does
anotherObject
anotherObject
copy the values of
someObject
someObject
into a new object? im new to the language and trying to develop an understanding
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ C# Powershell, pipe one script to another?
C#CC# / help
3y ago
❔ copy specific item from string array to another one
C#CC# / help
4y ago
✅ How to force C# to copy data?
C#CC# / help
3y ago
✅ how does one setup raylib with c#
C#CC# / help
3mo ago