Re: Setting up a class
On 2007-11-01 13:34, Michael Bell wrote:
Using Borland Builder 5 I am trying to get a very simple first working
use of a class to work. Following the example of the OU course MT262
as nearly as I can, I have Created files named Class First,
ClassSecond, and ClassThird. And it's still wrong!
Your first problem is that the "very simple first working use of a
class" is very complex (at least for being simple use of classes). Your
second problem is that whatever material MT262 uses it is not very
portable and contains much stuff that is specific to that material
(Borland specific perhaps?). If I were you and had the choice I would
pick up a gooc C++ book and use that instead.
It is a windows application, but I don't think that's relevant.
That is very relevant, since third part libraries are off-topic in this
group and will limit the amount of help you can expect.
NumberBoardType NumberBoardClass::Multiply(void)
{
int LocalNumber;
LocalNumber = NumberBoardType.Input1 * NumberBoardClass.Input2;
Here you use NumberBoardType as if it was an object, but it is a type
(as defined below). You need to create an object of type NumberBoardType
and perform the operations on that.
struct NumberBoardType
{
int Input1;
int Input2;
int Product;
};
--
Erik Wikstr??m