C++ Programming Tutorial 22 - Constants const, macro, and enum

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


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

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

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

fellow newbies, the internet says:
const is usually for single integers/settings
enum is for multiple integers/settings

shscotthoffman
Автор

I once heard about a city that never wanted to change. I think it was called...const-antinople 😎 In all seriousness, thanks for another amazing video!

PunmasterSTP
Автор

Unfortunately is NOT true that the 3 kinds of constants availables in c++ are 'more or less the same' as suggested by this video.
And introducing 'enum' with only one member is really confusig the viewers about the pourpose of 'enum'.

tonyudasher
Автор

You misspelled xylophone, but other than that, you have created great series, congratulations,

makercodes
Автор

Constant? or const int? (read it out loud)

salimahusain
Автор

const and macro can make only a single variable constant. E.g. const int x = 1;.
But if we want to make several variables constant? Would it be cumbersome to jot down all of them? Wouldn't it be nice if we could make all those variables constant in one go? Well, that's where enum comes into play.
E.g. enum season { x = 0, y = 1, z = 2};.
There you go.

brocklesnarufcchamp
Автор

Dammit this brought the ptsd back with the rapid fire of constants and the tea bag of "So now you understand the to finish it off.

ulukoruetc
Автор

#define X 10 --> Is not same as constant variables. Its a macro which simply gets replaced. Both are little bit different ;)

jstinsane
Автор

I have a question can you only put integer types in enum or can you also put doubles

helloworldof
Автор

Question: Does compiler assign any datatype for a macro? If so, what datatype does compiler picks for #define macro??

kpcPrasad
Автор

I don't think your definition of "hungarian notation" is correct. For example, hungarian notation would be intAge instead of int_age.

brethagen
Автор

Hi Caleb! Thanks for that, you really amazing in C++ programming, and thanks to you, now I can remember everything that the time did erase in my mind... Thank you again.
Man... There are something wrong here, I don't know if it was because I'm in Linux, but the compiler is ask me about declare enum. I'd correct it that way: enum test { y = 100 }.
Bye, now I will go to next video!

MatheusDiogo
Автор

I like the music in the end of every video:)

shadowmonarch
Автор

Best teacher ever sir

Love from India

🙏🙏🙏🙏🙏🥰🥰

supriyasutar