© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•12mo ago•
46 replies
Faker

✅ out vs ref keyword usage

Hello guys, can someone explain when to use the out keyword and when to use the ref keyword please. I understand that in both scenarios, behind the scene, a pointer is passed so that any change made is reflected back. I also read that ref need to be initialized before passing value as argument while out doesn't but out need to be assigned a value inside the method itself.

I don't understand where one is used over the other though... can someone explain please, any use cases/best practices.
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

ref vs out
C#CC# / help
12mo ago
ref keyword in C#
C#CC# / help
13mo ago
Confusing code with keyword ref
C#CC# / help
2y ago
✅ readonly keyword vs const keyword and use-case
C#CC# / help
12mo ago