• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

+=+=+=+=+...........some C++ help needed...........+=+=+=+=+

heat23

Elite Member
Heres a link to the question Problem # 3

i have no idea about this....the teacher already assumes we are c++ fiends...but i know nothing about it....ive read half of one of thise giant c++ reference guides...it doesnt mention anything about memory.....our textbook for our class is just an Algorithm book..so thers nothing in there...
any help would be appreciated


thanks
 

Point P
|
|
V
-----------------
| m_x 1 |
| m_y 2 |
------------------



Circle C
|
|
V
-------------
| m_x 3 |
| m_y 4 |
| m_r 6 |
-------------


That is the best I can do.....on a message board 🙂

Jim
 
speaking of C++, i really need it by tomorrow for my programming class. I just started Advanced C++, and my first homework is to be done in C++. Does anyone know where I can possibly "obtain" Borland C++? Much appreciated, thanks.
 
Install Linux and use their compiler.

Also you need to comment or describe how the variables p, c are represented in memory. Comment on the implications this has to implementing multiple inheritance.

Basically since "C" inherits all the properties of "P," it can also be considered a point. However, the point cannot be considered a circle because it does not contain the memory needed by the circle. Essentially, the internal data representations, assuming a 32-bit architecture, consists of a certain number of memory blocks which the compiler decides for the point. And the circle consists of the same number of memory blocks as the point, with additional memory blocks needed to represent the other data members and methods of the class Circle.

So the way this effects implementing multple inheritance is that at each higher level of inheritance you have greater amounts of memory that are allocated, including the required amount of memory for the lower class. Also, you can consider all higher inheritance classes equal to their lower classes but not the other way around. I think.



NOTE: If I'm completely wrong and what I just said is completely bogus, then please change or add additional comments. Thanks!

Edited: My thoughts got mixed up with my typing so I wrote something wrong. Corrected it.
 
hey thanks for the replies...
please correct me if im wrong....

a copy of the base class Point is maintaned in the derived class Circle, so basically, everyting in Point is also in Circle....therefore creating 2 copies of 'p' and one of 'c'
for implications....it takes up extra memory.....
 
Not just taking up additional memory but also the way you structure your solutions based on these classes.

Things that are effected are parameter passing, comparisons (you will probably have to use overload operators), assignments(overload operator =), etc.

NOTE: For all the other programmers, please add additional implications.
 
Don't you guys have a standard compiler that everyone needs to use, or at elast a unix box to telnet into? We all log into a server to turn in our programs and it uses that standard g++ compiler. If you compile your programs on different compilers (i.e. Microsoft) you may get away with errors that you wouldn't on others.
 
Back
Top