© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
10 replies
Catsillas

out ref local?

Seems I am able to do this:

ref int Test1(){
    return ref ints[1];
}
ref int Test1(){
    return ref ints[1];
}


but not this:

void Test2(out ref int a){
    a = ref ints[1];
}
void Test2(out ref int a){
    a = ref ints[1];
}


is there some syntax im missing or is this just not possible?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

ref vs out
C#CC# / help
12mo ago
✅ out vs ref keyword usage
C#CC# / help
12mo ago
ref keyword in C#
C#CC# / help
13mo ago