473,386 Members | 1,973 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,386 software developers and data experts.

Comments please

class A
{
public:
void methodinA();
}

class IFace
{
public:
virtual method1()=0;
virtual method2()=0;
};

class B : public IFace
{
A* ap;
public:
B(A* p) {ap = p;}
int methodinB() { ap->methodinA(); }
}

Is it a good way to pass a pointer of an object of A into to make
B::methodinB() be able to call A::methodinA()? Thanks!

Jul 22 '05 #1
1 972

"foggy" <fo***@turboweb.com> wrote in message
news:Cm********************@bgtnsc04-news.ops.worldnet.att.net...
class A
{
public:
void methodinA();
}

class IFace
{
public:
virtual method1()=0;
virtual method2()=0;
};

class B : public IFace
{
A* ap;
public:
B(A* p) {ap = p;}
int methodinB() { ap->methodinA(); }
}

Is it a good way to pass a pointer of an object of A into to make
B::methodinB() be able to call A::methodinA()? Thanks!


Without knowing anything more specific about your design, that is fine.
Jul 22 '05 #2

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

Similar topics

9
by: Adam Barr | last post by:
For a book I am working on, I have written a brief (9 page) summary of Python. The intent of this is that an experienced programmer who did not know Python would be able to get enough information...
1
by: Adam Barr | last post by:
For a book I am working on, I have written a brief (13 page) summary of Perl. The intent of this is that an experienced programmer who did not know Perl would be able to get enough information to...
5
by: Alex | last post by:
Hi all, We're looking at a vendor who uses the InterSystems Cache Database Platform, but our IT department has zero experience with this system. This software package will have a pivotal and...
39
by: Timex | last post by:
I want to delete all comments in .c file. Size of .c file is very big. Any good idea to do this? Please show me example code.
22
by: Adam Barr | last post by:
For a book I am working on, I have written a brief (7 page) summary of C. The intent of this is that an experienced programmer who did not know C would be able to get enough information to read and...
4
by: James Geurts | last post by:
Hi, I have a schema file defining objects. I then use xsd to convert that schema into a C# class file. Is it possible to have xmldoc comments added to the generated c# file? I have attempted to...
4
by: NewAlias | last post by:
How to display comments for each enum entry? 'Enum example with commnents commented Private Enum MyEnum YourName =1 ' Set this to get your real name YourAge=2 ' Set this to get your real age...
4
by: Vinayak | last post by:
Dear Members I'm new here. Please permit me to ask some newbie question I'm from a non-profit organization, working for gender equality. We wish to get a small message across to sister blogs...
40
by: jacob navia | last post by:
Recently we had poor Mr "teapot" that was horrified at the heresy of lcc-win of accepting // comments. C is a nice language, and you can do anything with it, inclusive a program that transforms...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.