Bro this helped me out big time. Also I have a question, what is the difference between a struct and a class? They seem the same to me. Aand last question: When and where should I use the private (function?) in class? Thanks again!
yea a class is basically a set of rules for the compiler to follow when it creates an object for it.. that's why there is a header file. the source file explains more in detail how the layout(implementation I think?) works.
@Thetimpson You think thats what it's called? Come back when your sure with more facts before you start taking rush actions. This is a beginners tutorial, before going into more complex its better to learn shortcuts around the base...
@papano12 That is most definitely not a good way of learning.
Please don't be stupid. I don't know much about classes in C++, which is why I watched your video, but I do know that you aren't simply changing the name. I'm 90% sure that you make an object of the class, which means that the object's name (in this case, "t") can access/use all the class (of which it's an object of) methods.
Having said that, I think your video is still very good - I just don't know why you explained wrongly :)
@papano12 The reason I'm here is to learn... Obviously.
But if I spot something that I think's wrong... I'm gonna query it.
And I disagree, you're just making it harder for the students, because objects and classes are considered the basics of C++ so it's best to learn it straight up, rather than beating around the bush.
@Thetimpson 't' is indeed an object. The example should be like this:
the name of the class should be "character"
and the object's name "Warrior" that has ATTRIBUTES inherited from the class it comes from.
In another way. instead of 't' you should write "Conan" which again would be on OBJECT of CLASS:Warrior and having the attributes of the class (health etc) he is from :)
but I don't understand why there is a semicolon after void attack..it's not just a declaration, its a definition too, so yea I see there are some things he could have done differently in here. lol.
thanks, that was quite simple and easy to understand.. I was always overhelmed when seeing others classes explanations.. do u have any more tutorials on classes?
What's the object part of the class? is it the cout part in the class closed by brackets or the functions in the class that provide you to use t.health and attack in main?
wow you are really good at teaching :D this made everything so much easier to understand with classes. but the whistle in your voice really annoyed me :P
man I swear i never understood what classes are! YOU ARE MY HERO! love you!
LeonardoKasperzioni 1 month ago
Thanks. I was having trouble understanding this topic. I have a crappy professor.
wwetrex 2 months ago
well done, and helpful. Thanks
1973rugger 3 months ago
can someone tell me whats the different in Classes and Structures?
iiperento 3 months ago
THANK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! you
TheFinalCreation 4 months ago
WDF!!!!!!
Does this program convey complete concept of classes......?
Hassanspy 5 months ago
Thanks! I already know Java and I was just looking for a quick and easy video to learn syntax...you hit the spot!
Project360Films 7 months ago
thanks for this tutorial! I finally get it!
danceswithsidhe 7 months ago
Bro this helped me out big time. Also I have a question, what is the difference between a struct and a class? They seem the same to me. Aand last question: When and where should I use the private (function?) in class? Thanks again!
VictoriusDawn 8 months ago
This has been flagged as spam show
Thank you very much. I was having trouble understanding classes, but you managed to explain everything perfectly.
waypastthat 8 months ago
Thank you very much. I was having trouble understanding classes, but you manage to explain everything perfectly.
waypastthat 8 months ago
yea a class is basically a set of rules for the compiler to follow when it creates an object for it.. that's why there is a header file. the source file explains more in detail how the layout(implementation I think?) works.
iceshadow625 8 months ago
@iceshadow625
yea sorry. its interface, that's the header file. the implementation is the source file. my badz
iceshadow625 8 months ago
You taught close to 11, 000 people the wrong thing.
(You aren't "changing warrior to t" - you're making an object (I think that's what it's called) of the class...
It's very different and easy to explain)
Thetimpson 9 months ago 16
@Thetimpson You think thats what it's called? Come back when your sure with more facts before you start taking rush actions. This is a beginners tutorial, before going into more complex its better to learn shortcuts around the base...
papano12 9 months ago
@papano12 That is most definitely not a good way of learning.
Please don't be stupid. I don't know much about classes in C++, which is why I watched your video, but I do know that you aren't simply changing the name. I'm 90% sure that you make an object of the class, which means that the object's name (in this case, "t") can access/use all the class (of which it's an object of) methods.
Having said that, I think your video is still very good - I just don't know why you explained wrongly :)
Thetimpson 9 months ago
@papano12 technically its both. You're technically making an instance of Warrior and calling it t
speewave 7 months ago
@papano12 thanks for this tutorial.
trueredexe 4 months ago
I learned it from the ground up -> and as a result didn't have to worry about bad habits that I'd need to unlearn, IF any exist.
travelsonic 3 months ago
@papano12 The reason I'm here is to learn... Obviously.
But if I spot something that I think's wrong... I'm gonna query it.
And I disagree, you're just making it harder for the students, because objects and classes are considered the basics of C++ so it's best to learn it straight up, rather than beating around the bush.
Thetimpson 1 month ago
@Thetimpson 't' is indeed an object. The example should be like this:
the name of the class should be "character"
and the object's name "Warrior" that has ATTRIBUTES inherited from the class it comes from.
In another way. instead of 't' you should write "Conan" which again would be on OBJECT of CLASS:Warrior and having the attributes of the class (health etc) he is from :)
Panagis1980 8 months ago
@Thetimpson
yea it's declaring t as an object of warrior.
but I don't understand why there is a semicolon after void attack..it's not just a declaration, its a definition too, so yea I see there are some things he could have done differently in here. lol.
iceshadow625 8 months ago
@Thetimpson why don't u make a tutorial instead of just saying shit?
LeonardoKasperzioni 1 month ago
@LeonardoKasperzioni I actually plan to...
Thetimpson 1 month ago
many thanks
ammarbat2003111 10 months ago
Consider indenting the curly brackets to match the method's indentation.
PixelOutlaw 10 months ago
thanks, that was quite simple and easy to understand.. I was always overhelmed when seeing others classes explanations.. do u have any more tutorials on classes?
KillerkoUK 11 months ago
This helped a lot. What program do you use? My teacher makes us use Microsoft Visual Studio.
Insanox2 11 months ago
@Insanox2 Dev C++
KielSives 10 months ago
What's the object part of the class? is it the cout part in the class closed by brackets or the functions in the class that provide you to use t.health and attack in main?
DeuceisLegit 11 months ago
This was pretty easy to understand, and it was straight forward. Nice!
alienking2 1 year ago
nice for beginners. tho i rather object orient program in c++. makes it much better looking and easier to find.
Thats atleast what ive learned is the best way to do it.
2 diffrent files, one .h & one .ccp. Header got the info & ccp file got what ur class actualy do.
Public: void LoseHealth(int amount);
Private: int health;
Necry3d 1 year ago
i wish you taught my cs class instead of my professor.
tinkothekoala 1 year ago
thx man made lot of sense!!
sukha853319 1 year ago
Thank you so much, I've watched an unbelievable amount of other tutorials on classes but they just didn't make any sense. ty ty!
AionLuottamus 1 year ago
This tutorial is great.
WeretFilms 1 year ago
members should be private
methods should be public
methods should manipulate the members.
amino0o 1 year ago
shit i always wanted to know what that dot was for!
gaztheace 1 year ago
very nice and well explained!
gatraw 1 year ago
do you also have other tutorials .... i understand you man,,,
MrYomantanepali 1 year ago
Thanks alot was really easy to understand
trapedd 1 year ago
thans a lot
99krishnasampath 1 year ago
I friggin love you!!!!
Stephenson24 1 year ago
wow you are really good at teaching :D this made everything so much easier to understand with classes. but the whistle in your voice really annoyed me :P
GalaxyMoose 1 year ago
you are god
hornymanonfire 1 year ago
you are a great teacher!!!
ASadisticPerson 1 year ago
oah.... big, BIG thanks!!!
i am reading a book about object oriented programming with C++
but before I watched this tutorial I'd never understand that. :)
and I have to say you that I think all your tutorials are very, VERY good!
thumbs up!!!
arnedussin 1 year ago
Thanks. This was great
trunks6262 1 year ago
too easy to understand,,,, great explanation , thanks
my3d3d 1 year ago
This was much easier to understand then most others i've watched. Thanks!
CrackahJackJoe 1 year ago 8
@CrackahJackJoe Np, anytime.
papano12 1 year ago
Great short tutorial.
kelofarrar 1 year ago
thanks!
IluvHKong 1 year ago
very nice!
bloodfoxtrue 1 year ago
@bloodfoxtrue Thanks, I like to keep it simple.
papano12 1 year ago
Thank you for this:) Been trying to understand this part for a few days. Keep up the good work!
Inferningflames 1 year ago
good video
legendy2j 1 year ago
I was having some trouble on this. You broke it down nice with the 'Warrior' example. Cheers!
Shogun2k7 1 year ago
one question...why do you prefer dev-cpp environment? Don't you like more code blocks ore something?
janezbboy 2 years ago
good work!
thanks for posting
i have learned a lot :)
jhelayne28 2 years ago
very good!
ghostreconproducoes 2 years ago