Oriented Object's question

Hi. I1m studying C++'s oriented object, and so, I have one question. I have this code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>

using namespace std;

class plusNumber {
	int x;
	public
		void MathCount (int);
		int Result () {
			return (x+x);
	}
};

void plusNumber::MathCount (int a) {
	x = a;
}

int main() {
	plusNumber rect; //What is "rect" ?
	rect.MathCount (3);
	count << "The result is: " << rect.Result();
	return 0;
}


So. But I don't know the utility of any parts. For example:

plusNumber rect;

What is "rect" ?


Anybody can help-me plz?

Thanx.
rect is the name of the plusNumber object.

Here is an int called x -

int x;

Here is a char called beansOnToast -

char beansOnToast;

Here is a plusNumber called rect -

plusNumber rect;
Last edited on
Topic archived. No new replies allowed.