Purepain
Newbie

Posts: 6
|
 |
« on: April 09, 2011, 01:55:20 PM » |
|
I am in school, so I want to point that out to anyone that helps me out as so they know. I don't want anyone to do my work for me, but I am having issues understanding a bunch of things and I would just like someone that knows how to use c++ and has some spare time to walk through a few thoughts and ideas.
Right now I am working with classes and derived classes so this will be the focus of some of my questions.
|
|
|
|
|
Logged
|
|
|
|
Purepain
Newbie

Posts: 6
|
 |
« Reply #1 on: April 09, 2011, 04:20:08 PM » |
|
I have seen a few of y'all looking at my post but no response. I am not sure why, if it is because no one wants to do someones else homework. I can understand that, that is not what I am looking for. I have read and read and re-read books. I understand what the books say to do, I don't understand how to do it. I just would like the chance to talk to someone that knows about programming and compare what I think it should be to what they know it should be. This way I will be able to better understand how to work with the c++ and be able to think and do this for myself. My first questions have to do with building a base class and then using that base class to create a derived class and make changes to the derived class. I hope that someone will respond, I am very new at this and need to find a better understanding so that I can continue in my education thank you ahead of time for all of your help.
|
|
|
|
|
Logged
|
|
|
|
Damien24
Newbie

Posts: 19
|
 |
« Reply #2 on: April 09, 2011, 05:42:16 PM » |
|
Videos 30-42 under videos-C++-Console all basically teach some aspect of polymorphism. You should check them out, they're easy to understand and will probably answer any questions you have. If you have a specific question in regards to some code I might be able to help you, however, I'll need to see the code in question. Also, I'm brand new to C++ to but I understand basic polymorphism.
|
|
|
|
|
Logged
|
|
|
|
Purepain
Newbie

Posts: 6
|
 |
« Reply #3 on: April 09, 2011, 08:55:15 PM » |
|
That's cool I will check out the videos, the code that I am working on right now is a class. It is a date class that outputs the user input and returns the date back in different ways. Then after I set up the base class I used it to set up another class called fancy date class. The fancy date class uses all of the variable that were part of the base class then I added other functions that will return other information based on the user input of the date. The fancy date class has the leap year and the Julian date and string function the will change the numeric date into the day of the week and the name of the month. After I watch some of these videos I will post my working code and see what you think about it as long as you don't make too much fun at it I am way new at this and trying to get it figured out still.
|
|
|
|
|
Logged
|
|
|
|
Purepain
Newbie

Posts: 6
|
 |
« Reply #4 on: April 10, 2011, 11:42:51 AM » |
|
Ok, here is what I understand so far:
when setting up a class you start by defining the group that it belongs to. Then try to see if there is a simpler group that that is included in. Like if you staring class was flowers you could back up and include the flower class into a base class called plants.
Class private:
protected:
public:
Once you define the class group then you set your template up as in the above to start to group the classes members into groups that will control the user access to the code information. Once you have your member groups set up then you start to define the different members that belong in each group. Starting with the things that make up the class and then moving into the different actions that the class will preform. Ok, I am going to stop there and give someone else a chance to expand on this a little while I go and watch some more videos and read. By the way if you are one of the programmers that have helped to provide the videos thanks, they are very cool.
|
|
|
|
|
Logged
|
|
|
|
Damien24
Newbie

Posts: 19
|
 |
« Reply #5 on: April 10, 2011, 10:40:17 PM » |
|
Everything sounds good so far. I'm not one of the programmers involved in making the videos for this site; I found xoax on youtube looking for tutorials on C++. I'm not familiar with the "protected" member group I was wondering if you might be able to explain it's purpose haha. I'm still pretty new myself keep in mind. I'd also like to know how much more information you're learning in school vs. online because I'm curious whether or not I could learn C++ on my own or if I might want to consider going to school to continue learning C++ concepts. Thanks you for any answers to my question and so far it looks like you're understanding everything well.
|
|
|
|
|
Logged
|
|
|
|
Purepain
Newbie

Posts: 6
|
 |
« Reply #6 on: April 10, 2011, 10:50:41 PM » |
|
Sure I can help you with that, I think anyway. When creating base classes and using them to derive classes it is sometimes necessary to access the members that are not public to the user. You can use the protected type for this. You can also send the information stored in the protected member of the base class to another variable so that you can then access that variable in the derived class and use the information that is stored inside. As you can see it is much easier if you are the programmer of the base class and you don't mind you work being changed to make any private variable protected instead so that you can reuse you work efforts later. I think that this is the right answer anyway from what I have read some far. I know there are others here that are so much better at this then myself is this the right way to explain the protected type class member?
|
|
|
|
|
Logged
|
|
|
|
|