Please understand that I have a strong fever while writing this, and, in addition, it is years ago since I have used C++ - or classes for that matter.
My problem consists in the g++ compiler rejecting my calling of the class identifier (+ the member specifier), and the actual member of that class.
Here is what I mean:
class window{
public:
int borderX, borderY, menu_item;
};
If I choose to call one of these members (boderX, borderY, menu_item), like so:
window.borderX = [some value here];
I get an error in return:
error: expected unqualified-id before '.' token
When I look at cplusplus' website, this code is NOT grammatically incorrect. Yet, it refuses to compile?
Here is an example from cplusplus' website:
class CRectangle {
int width, height;
public:
void set_values (int, int);
int area (void) {return (width * height);}
};
CRectangle rect;
rect.set_values (3,4);
This code does NOT compile either!
It returns this error:
error: 'rect' does not name a type
I don't understand why it returns these errors. Window IS used as an identifier - or a type thereof. And secondly, it won't EVEN compile the code from the very website itself which TEACHES the use of C++.
I am waiting to be corrected on these matters. Also, for the record, I am using MingW. Both Code::Blocks and Netbeans yield the same results (yes I KNOW they're IDEs, and not compilers.)