C++Tutorial for Beginners 32 - Getters and Setters

preview_player
Показать описание
-------------------------------------------------------------------------------------------------------------------------------------------
Getters and Setters are methods are are used to access your object's instance data. All the rage in object oriented programming some years ago, but now latest thinking in C++ holds that you should avoid using them where possible. But they're still sometimes needed and vital to know about.
--------------------------------------------------------------------------------------------------------------------------------------------
Рекомендации по теме
Комментарии
Автор

i was also having the same issue as plushoom but realized that visual studio wouldnt let me compile without #incliude  <string>. Its not in the videos code but thats a different compiler

Mr.Pop
Автор

Hey getting into college next year in computer science technology and I'm hoping to get some knowledge before so I don't get left behind ( D: ) and man It's getting fun :D greats videos and atmosphere c: thank you for posting

ArielVolovik
Автор

I was tagging along pretty well until you said George had a sex change.

Now I gotta watch the whole thing over because, I got lost... worth it though :D

FreshCoastDon.
Автор

Can someone please explain how setName() can change a string that's in a class and hasn't been passed trough the parameters, sorry if I'm talking nonesense, but it's hard to explain something you don't quite understand. And even then the variable must get returned if it's going to affect anything in a class / function ?? I'm cunfused. I know Getters and Setters, but I don't know how they work.

AlbzterNinja
Автор

It sounds like this guy is actually in a cave man.

thescroogemcduck
Автор

why should we use setters and getters.... i dont get the reason to use it.. if u wanna change variables value itss quite easy so why then this process

aghajan
Автор

Man, starting with classes. You got me totally lost. Why can't  you just create the class and get it over with. Then do the other stuff. Oh!, and Yes, it is confusing to see your objects named the same as the Ok, this where I get off, and search for another channel. Chao.

jgbcjgbc