---
title: "What is friend function in c  ?"  
description: "What is friend function in c  ?"  
author: "Anonymous User"  
published: 2013-06-14  
updated: 2013-06-15  
canonical: https://www.mindstick.com/forum/1116/what-is-friend-function-in-c  
category: "visual c++"  
tags: ["visual c++"]  
reading_time: 1 minute  

---

# What is friend function in c  ?

Hi,\
What is [friend function](https://answers.mindstick.com/qa/92532/what-is-a-friend-function) in [c++](https://www.mindstick.com/blog/745/array-in-c-plus-plus)?\
Thanks in advance.

## Replies

### Reply by AVADHESH PATEL

A friend is not a member of a class but still has access to its private elements.Two reasons that friend functions are useful have to do with operator overloading and the creation of certain types of IO functions.A friend [function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) is defined as a regular ,nonmember function. However,inside the class declaration for which it will be a friend,its prototype is also included,prefaced by the keyword friend.\


---

Original Source: https://www.mindstick.com/forum/1116/what-is-friend-function-in-c

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
