C++ Programming Tutorial 91 - Static Data Members

preview_player
Показать описание


~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~

🅑 Bitcoin - 3HnF1SWTzo1dCU7RwFLhgk7SYiVfV37Pbq
🅔 Eth - 0x350139af84b60d075a3a0379716040b63f6D3853
Рекомендации по теме
Комментарии
Автор

oh my god the first person to explain without advanced word thanku caleb i ca always count on u

rephilibilly
Автор

Wow, knowing Java really helps when learning C++

chadwickcodes
Автор

it get difficult from vid 89, thank you a lot caleb your videos really helpful

iyedkahwech
Автор

Thank you so much. I'm your student from Bangladesh. your video helps me a lot.

_SabiqunnaharBrinty
Автор

cant we just instantiate the static member inside the constructor? isn't it when the class is invoked or called we allocate memory that includes the members?

kid_kulafu_
Автор

Currently in this chapter (14) in the Gaddis Text for C++ in class. Your tutorials have just been discovered by me and they’re helping! Quick question for you: I define which constructor I wish to use at any given object declaration in main right? I can do something like className obj; or className obj(var type/name parameter) etc.. and this is all based on the use case and what my program is being meant to do correct? I am having trouble understanding why the hell I need to make multiple constructors when I can just continually use setter methods on multiple objects .

tannerbarcelos
Автор

Inline? More like in time...to help a lot of people before their exams (judging from the comments). Thanks so much for this wonderful tutorial series!

PunmasterSTP
Автор

My understanding for now is that
both default constructor and custom constructor can be defined in the same file
but we cannot instantiate s class into multiple objects using both custom constructor and default constructor in a main function.
Is that correct?

cafelashowerezweb
Автор

I am confused about the destructor,
At 6:25 although you haven't call the destructor explicitly, it has executed the cout and written "Destructor"
but why not executed the user_count-- statement same way? Why do we have to call the destructor explicitly?

ironiclove
Автор

Noob here. When he minimized the class, my jaw hit the floor. I've been doing so much scrolling.

masonantram
Автор

In a multi file setup, where would one define the static variable from a class, would it be in the main.cpp, or the class.cpp? My testing shows the app works either way. It doesn't work if I define the static variable in the class.h file, which may make sense as a header file is normally used to declare items, not define them. If I had to choose, I would put it in the main.cpp, but would like to do it according to best practice...Thx IanQ

ianq
Автор

When I run
cout << User::get_user_count << endl; in Visual Studio

it outputs what I think is user_count's address (008617E4) instead of its integer value. Any idea why?

Thunder_Mage
Автор

your explanation on why u need to declare static outside the class didn't make any sense man. when u make a new object to the class, it should recognize the static variable also. there's no reason for it not to

reenamola