473,395 Members | 2,079 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,395 software developers and data experts.

What is a "Friendless Class" in C#?

xarzu
88 64KB
What is a "Friendless Class" in C#? I heard someone refer to it but I googled it online and found nothing.
Oct 18 '12 #1
2 1246
weaknessforcats
9,208 Expert Mod 8TB
A friend is a C++ concept. You don't find this concept in C# or anywhere in OOP.

C++ is not an object-oriented language. It is a structured language like C. There are techniques allowing a non-class member to access private class members and bypass all that OOP stuff and write a good old structured program.

You simply can't do this in C#.
Oct 19 '12 #2
PsychoCoder
465 Expert Mod 256MB
While it's true friend isn't available in C# (probably for the best as well) you can get close with the internal modifier and the InternalsVisibleTo Attribute.

Just an FYI :)
Oct 19 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: dpr | last post by:
I have come accross a piece of C++ code with the construct: MyClass *c = new class MyClass(); Is there a difference between this and: MyClass *c = new MyClass(); ?
0
by: Gianni Mariani | last post by:
It started out as an ugly hack and it turned out to be very easy to do but I'm concerned about wether I'm not seeing somthing so I'm asking the wise ladies and gents of clc++ as to wether they turn...
6
by: Stephen Johns | last post by:
I want to have a Hashtable whose keys are strings and whose values are delegates. Well, ok, I have that: dels = new Hastable(); dels.Add( "key", new Foo1Delegate(MyFoo1) ); dels.Add( "key",...
9
by: Neil Kiser | last post by:
I'm trying to understand what defining a class as 'static' does for me. Here's an example, because maybe I am thinking about this all wrong: My app will allows the user to control the fonts...
0
by: Winterminute | last post by:
I am trying to read a list of install programs using WMI with ASP.NET/C#. However, it fails with "Invalid Class". I have confirmed that if I query LOCALHOST then it works fine, but if I query a...
0
by: Jaime Lucci | last post by:
Hi everyone! I have a problem that I can't resolve. In VB2005 I've programmed a new class, where I use a Windows Form with four controls: a SplitContainer, a Panel, a Label and a...
4
by: Yarco | last post by:
In c++ we could modify the private variable in a class use friend keyword. How could it be done in php? class YourBag { int money; friend class Thief; // friend? };
3
by: Matt | last post by:
Hi everyone, can someone point out the difference between defining a class with the public access modifier and just leaving it as it is (default in vs.net "class") I think that the default...
3
by: Ravi | last post by:
Is this the correct way to think of "base class"? The "base class" is a class from which other classes are derived. The "base class" will never be derived from another class.
1
by: Guy Shahbazian | last post by:
I need to convert the following code in CF From : <APPLET CODE="BarChart.class"CODEBASE="/classes/CFGraphs/" WIDTH="750" HEIGHT="250"> To : CFchart because I should run under CFMX7 Thanks
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.