---
title: "out and ref keywords in c#."  
description: "out and ref keywords in c#."  
author: "James Smith"  
published: 2011-04-28  
updated: 2026-05-15  
canonical: https://www.mindstick.com/forum/231/out-and-ref-keywords-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# out and ref keywords in c#.

Could [anyone](https://www.mindstick.com/articles/23207/how-to-find-the-best-fit-job-for-anyone) [please explain](https://www.mindstick.com/forum/344/hi-rohith-i-am-new-for-mvc-please-explain-how-to-set-implicitly-isauthenticated-true) me in some [detail](https://www.mindstick.com/forum/157518/what-is-svm-algorithm-and-also-explain-it-in-detail) with an example that what is [difference](https://www.mindstick.com/articles/157114/good-news-or-bad-news-and-the-difference-is) between out and [ref](https://www.mindstick.com/interview/217/what-is-the-difference-between-ref-out-parameters) [keywords in c#](https://www.mindstick.com/forum/159058/what-s-the-difference-between-the-ref-and-out-keywords-in-c-sharp).\
Thanks in advance.

## Replies

### Reply by Amit Singh

**ref [keywords](https://www.mindstick.com/articles/12899/how-to-spot-if-you-re-optimizing-for-the-wrong-keywords):**\
When we want change in passed parameter to the method then we pass it by reference with the help of ref keyword in actual and formal parameters. By passing parameter by reference actual address of the parameter is passed to the method and changes made to the parameter in method reflect in actual parameter passed.\
**out Keywords**\
Passing parameter by out is somewhat like ref but the difference is that it is unidirectional i.e. we do not need to initialize the passed variable but we get back the processed value. Likewise Reference parameter we need to use out before variable in output parameter.\
\
**For Example:**\
Please check this link:\
http://mindstick.com/Articles/bcf933f0-0140-4bc6-a725-4edb2743b988/


---

Original Source: https://www.mindstick.com/forum/231/out-and-ref-keywords-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
