![]() |
| | #1 |
| Registered User Join Date: Oct 2001
Posts: 3
| |
| Cruise79 is offline |
| | #2 |
| Banned Join Date: Oct 2001
Posts: 1,784
| Use the public identifier before you declare your methods and a private scope identifier before you declare the data members of the class. Give it a try. |
| Troll_King is offline |
| | #3 |
| Registered User Join Date: Oct 2001
Posts: 125
| You will need to create a class with private members such as position (x, y) and radius, and public methods according to your needs. Don't forget about constructor(s) and desctructor. Hope this helped.
__________________ 1 rule of the Samurai Code: if you have nothing to say, don't say anything at all! |
| Engineer is offline |
| | #4 |
| Guest Join Date: Aug 2001
Posts: 4,923
| Think of a class as a special kind of struct. Nothing more. Then just realize that now you can not only have a structure which can hold data, but one that can "hold" functions, create itself, destroy itself, initialize itself(automatically set it's members to zero, sets strings to desired preset values[maybe char *name = "None Yet";]), morph itself according to the arguments it recieves ( even the Types! ), change the meanings of operaters such as "=" applied to it, and of course, who can hide or show it's data to other classes, etc.,etc, etc. But you have to try doing all this yourself! For a class is only worth what it's programmed to do! You could in fact start small, and write it precicely like a struct. Slowly build on it till it becomes more useful and modualer. Eventually, you will get the hang of it, but don't just ask someone to do it for you. Try it and see for yourself! |
| Sebastiani is offline |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can you Initialize all classes once with New? | peacerosetx | C++ Programming | 12 | 07-02-2008 10:47 AM |
| Wiki FAQ | dwks | General Discussions | 192 | 04-29-2008 01:17 PM |
| im extreamly new help | rigo305 | C++ Programming | 27 | 04-23-2004 11:22 PM |
| include question | Wanted420 | C++ Programming | 8 | 10-17-2003 03:49 AM |
| FAQ Check/Lock | RoD | A Brief History of Cprogramming.com | 2 | 10-15-2002 11:21 AM |