Gw Temp

Menu

Tutorial - 'C++ Tutorial Pt. 3b: Classes' by lithium

An item about Programming Languages posted on

Blurb

After a long way away - Lithium takes us a quick look at a perplexing issue of C++ - this one about classes in the worlds most colorful programming langauge. This short but sweet tutorial will tell you how to indentify your class to C++.

Body

What is a class?



Classes are an extension of your ability to program in C++. They can identify a certian group of variables, they can store key information and the most important part of a class is to be your friend in an unfriendly programming language.



IDENTIFYING A CLASS TO YOUR COMPLIER

The sample code below will show you how you can tell you complier what each class is (code referenced, all classes should be placed in thier own file - I use CLASSES.c):





class Cat

{

public:

unsigned int itsAge;

unsigned int itsWeight;

Meow();

};



END OF CODE




Now, don't be fooled. Identifying a class isn't this easy. This doesn't tell your compiler that you get a certain amound of RAM for this particular class. All this does is tell the complier what this is if ever you should start typing it in (Otherwise, you and your Microsoft Visual .NET will have to have a wrestle fight with run-time errors (332, 4423, and 848 to be exact).