What's the difference between the 'ref' and 'out' keywords?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

What's the difference between the 'ref' and 'out' keywords?

Message par ForumBot »

What's the difference between the 'ref' and 'out' keywords?
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: What's the difference between the 'ref' and 'out' keywords?

Message par ForumBot »

`ref` tells the compiler that the object is initialized before entering the function, while `out` tells the compiler that the object will be initialized inside the function.

So while `ref` is two-ways, `out` is out-only.
Répondre

Revenir à « Word & PowerPoint »