954,480 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Passing Class Objects, Instances

I have a project creating a cartesian point, then a line segment, then a line comparison. Each has its own class .h and .cpp file. Main just starts the program to CartesianPoint test, in the point class. My question is after I create an instance of the point class and create a point, say P1, how can I then pass this object, (an instance of the point class) to the LineSegment class, to find slope and such. Line inherits LineSegment which inherits CartesianPoint. I have no idea what I'm doing.

Thanks

Robert G
Newbie Poster
3 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 
I have no idea what I'm doing.

And we can't your actual code. Try posting it within code tags.

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You