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

Reg virtual function and friend function

Hi all!
Please explain the usage of virtual function and friend function
with some examples.
Thanks,
Sudha.
Nov 14 '05 #1
5 1534
csudha wrote:
Hi all!
Please explain the usage of virtual function and friend function
with some examples.
Thanks,
Sudha.


We also do not have these in C.
Read the c.l.c++ FAQ or buy the book by Stroustrup.

-Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Nov 14 '05 #2
csudha wrote:

Hi all!
Please explain the usage of virtual function and friend function
Both of these identifiers are in "user namespace", so you can make
them do whatever you like.
with some examples.


#include <stdio.h>

int virtual(void)
{
return printf("Hello, virtual reality.\n");
}

int friend(void)
{
return printf("Hello, friend.\n");
}

Or whatever. The world is your oyster.
Nov 14 '05 #3
infobahn wrote:
csudha wrote:
Hi all!
Please explain the usage of virtual function and friend function

Both of these identifiers are in "user namespace", so you can make
them do whatever you like.

with some examples.

#include <stdio.h>

int virtual(void)
{
return printf("Hello, virtual reality.\n");
}

int friend(void)
{
return printf("Hello, friend.\n");
}

Or whatever. The world is your oyster.


Splendid *g*
Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Nov 14 '05 #4
infobahn wrote:
csudha wrote:

Please explain the usage of virtual function and friend function


Both of these identifiers are in "user namespace", so you can make
them do whatever you like.
with some examples.


#include <stdio.h>

int virtual(void)
{
return printf("Hello, virtual reality.\n");
}

int friend(void)
{
return printf("Hello, friend.\n");
}

Or whatever. The world is your oyster.


You are in a devious mood today. Unfortunately the reply doesn't
point out the error of his ways - ask C++ questions in a C++
newsgroup, not a C newsgroup.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
Nov 14 '05 #5
CBFalconer wrote:

You are in a devious mood today. Unfortunately the reply doesn't
point out the error of his ways - ask C++ questions in a C++
newsgroup, not a C newsgroup.


I remain to be convinced that they were C++ questions. :-)
Nov 14 '05 #6

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

Similar topics

6
by: Victor | last post by:
Anyone knows how to write a virtual function for operator<< ? I have a base class and some public derived class from it. For the derived class, I hope they can use << to output their different...
0
by: Brian Henry | last post by:
Here is another virtual mode example for the .NET 2.0 framework while working with the list view. Since you can not access the items collection of the list view you need to do sorting another...
11
by: Nindi73 | last post by:
A few days a ago I posted my code for a deep copy pointer which doesn't require the pointee object to have a virtual copy constructor. I need help with checking that it was exception safe and...
5
by: druberego | last post by:
I read google and tried to find the solution myself. YES I do know that you can get undefined references if you: a) forget to implement the code for a prototype/header file item, or b) you forget...
6
by: Gerhard Prilmeier | last post by:
Hello, I have an unmanaged C++ API that uses virtual functions, like this: class A { public: virtual void handleMe(){} };
7
by: Markus Svilans | last post by:
Hello, My question involves virtual functions and inheritance. Suppose we have a class structure, that consists of "data" classes, and "processor" classes. The data classes are derived from...
5
by: noone | last post by:
hi. I don't use exceptions much in the embedded world, but for my plugin interface to a hardware MPEG encoder I'd like to, since there are so many places that the crummy kernel driver can do bad...
1
by: mosfet | last post by:
Hi, I am trying to modify existing code to use smart pointers and I get some issues with virtual methods : class Folder : public Object { public: friend class PimItemCollection; friend...
6
by: Vijay Meena | last post by:
Hi, Private functions can be virtual in C++ ( unlike Java) ? What is the use of private virtual functions ? Below is the code - #include <iostream> class Foo { public: virtual void test()...
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: 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
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
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.