473,396 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Friend

How can I use friend functions in C# like C++?
Nov 16 '05 #1
2 3750
The closest thing that you have in C# is the internal keyword, which
means that any other type in the same assembly can access the member/type.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"msnews.microsoft.com" <da*********@hotmail.com> wrote in message
news:eP****************@tk2msftngp13.phx.gbl...
How can I use friend functions in C# like C++?

Nov 16 '05 #2
q
There are no 'friend' functions in C#.

internal:
Access is limited to the current project.

protected internal:
Access is limited to the current project or types derived from the
containing class.

msnews.microsoft.com wrote:
How can I use friend functions in C# like C++?


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dmitry D | last post by:
Hi all, I'm having problems with declaring a template friend function. It seems like I've done everything as explained in C++ FAQ, but still, I'm getting the linker error (unresolved external...
15
by: Samee Zahur | last post by:
Question: How do friend functions and static member functions differ in terms of functionality? I mean, neither necessarily needs an object of the class to be created before they are called and...
7
by: Steve | last post by:
I'm just curious, why did give VB.Net a Friend keyword but not C#?
2
by: K. Shier | last post by:
Friend variables "are accessible from within the program that contains their declaration and from anywhere else in the same assembly." according to the VS.Net help. This sounds like a pretty broad...
9
by: Adam Badura | last post by:
I have code like this template<int size> big_int { /* ... */ template<int size2> friend class big_int<size2>; }; What I wanted to achive is to be able to easly convert different sized...
2
by: freegnu | last post by:
how to declare a friend function that can access two class it will look like the following class A { private: int i; public: A(){} ~A(){} friend void call(A &a, B &b);
5
by: Steven T. Hatton | last post by:
This note appears in the discussion of name hiding and uniqueness: §3.3 #4 This note is item #6 in the discussion of "Point of declaration" §3.3.1 #6 What exactly do these statements mean?...
3
by: Filimon Roukoutakis | last post by:
Dear all, I have the following concept name { space1 { class Friend { };
5
by: tuananh87vn | last post by:
hi, I'mm writing script for adding friend to a friend list.i'm using a form including friend_name (text), message (textarea) and below is my code: if(isset($_POST)) { ...
6
by: WaterWalk | last post by:
I find friend declaration just very tricky. I tried the following examples on both MingW(gcc 3.4.2) and VC++ 2005. The results are surprising. Example1: namespace ns1 { class Test { friend...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.