Const Data Member In C++

  Рет қаралды 22,684

CppNuts

CppNuts

Күн бұрын

JOIN ME
-----
KZfaq 🎬 / @cppnuts
Patreon 🚀 / cppnuts
COMPLETE PLAYLIST
------------
C++ Tutorial For Beginners: • Introduction To C++
STL (Standard Template Library): • STL In C++
ThreadIng In C++: • Multithreading In C++
Data Structures: • Data Structure
Algorithms: • Binary Search
Design Patterns: • Factory Design Pattern...
Smart Pointers: • Smart Pointer In C++
C++14: • Digit Separator In C++
C++17: • std string_view in C++...
C++ All Type Casts: • static_cast In C++
INTERVIEW PLAYLIST
------------
C++ Interview Q&A: • Structural Padding & P...
C++ Interview Q&A For Experienced: • How delete[] Knows How...
Linked List Interview Questions: • Find Kth Node From Bac...
BST Interview Questions: • Search Element In Bina...
Array Interview Questions: • Reverse An Array
String Interview Questions: • Check String Is Palind...
Bit Manipulation Questions: • Find Set Bit In Intege...
Binary Tree Interview Question: • Invert Binary Tree
Sorting Algorithms: • Bubble Sort
C++ MCQ: • Video
C MCQ: • What printf returns af...
C Interview Questions: • Designated Initializat...
QUICK SHORT VIDEOS
-------------
C++ Short : • C++ Short Videos
C Short : • Shorts C Programming MCQ
In this video we will learn about the "const data member" in c++ programming language.
There are few points about the same as follows:
1. They are constant so can not be changed once initialised.
Ways to initialise:
1st Way: Initialise in class
2nd Way: Initialiser list is used to initialise them from outside.
#cpp #tutorial #programming #coding #cppprogramming #computerscience #softwareengineering

Пікірлер: 28
@AhmedKhaled72
@AhmedKhaled72 3 жыл бұрын
I really liked your way of delivering videos, could you tell me how can I study c++ or any programming language, in general, the right way? Thanks in advance,
@CppNuts
@CppNuts 3 жыл бұрын
If you need my kind of knowledge then you have to go through stack overflow section of c++, and try to read questions and answers and read all the answers.
@nikhilpandey5609
@nikhilpandey5609 4 жыл бұрын
Bro u r awesome....thanks for sharing ur knowledge . Please make some videos on interesting projects in cpp
@CppNuts
@CppNuts 4 жыл бұрын
Noted
@keerthanraobj2149
@keerthanraobj2149 3 жыл бұрын
Very good explanation with practical example sir
@CppNuts
@CppNuts 3 жыл бұрын
Thanks and welcome
@ankushladani496
@ankushladani496 2 жыл бұрын
Nice explaination...👏👏
@VasaMusic438
@VasaMusic438 5 жыл бұрын
Very good tutorial !! Thanks!!
@CppNuts
@CppNuts 5 жыл бұрын
Thanks for your comment!!
@behindthescene4406
@behindthescene4406 4 жыл бұрын
Hey can u help at 14:08 why output are like constructed Constructed Motog4 iPhone ... Why not like constructed motog4 Constructed iPhone
@andrezaodausp
@andrezaodausp 2 жыл бұрын
omg, best programming channel ever ever
@CppNuts
@CppNuts 2 жыл бұрын
Thanks dude..
@azrflourish9032
@azrflourish9032 2 жыл бұрын
oh yeah ! thanks!
@CppNuts
@CppNuts 2 жыл бұрын
Welcome...
@sujayfarkade3289
@sujayfarkade3289 10 ай бұрын
great !!!!
@mapradnardev
@mapradnardev 10 ай бұрын
I have a simple class class base{ public: const int x; base(){cout
@CppNuts
@CppNuts 10 ай бұрын
First of all the syntax is wrong for second Ctor.
@santhoskumar1369
@santhoskumar1369 5 жыл бұрын
Follow up : we can change values of const variables or members through pointers. Eg. *(string*)&p1="Sample"; will change pname of p1 even it is given as private.
@behindthescene4406
@behindthescene4406 4 жыл бұрын
Hey can u help at 14:08 why output are like constructed Constructed Motog4 iPhone ... Why not like constructed motog4 Constructed iPhone
@santhoskumar1369
@santhoskumar1369 4 жыл бұрын
@@behindthescene4406 because constructor will be called during object creation, then only functions are called as per the program.
@behindthescene4406
@behindthescene4406 4 жыл бұрын
When fcn are called them it must be in sequence na...that's my doubts
@huistv2005
@huistv2005 2 жыл бұрын
Is there an answer to this pointer question?
@chrischatergoon3207
@chrischatergoon3207 4 жыл бұрын
Great video. But 5 ads? Really takes away from the video.
@CppNuts
@CppNuts 4 жыл бұрын
Now they've started putting more ads
@raja28chowdhury
@raja28chowdhury 3 жыл бұрын
its not in his control and use add blocker if you want :p
@cid007007
@cid007007 4 жыл бұрын
i am changing already initialized constant variable using initializer list, it should give compilation but it compiled and giving output : #include using namespace std; class Base { const int x=90; public: Base(int a):x{a} {} void getX(){ cout
@behindthescene4406
@behindthescene4406 4 жыл бұрын
He already told that .....intializer list only work with constructor as you already assigned value to it ...it will be showcasing u the same value ...if u won't intialyzes at early stage definitely it will throw error
@keshavbajaj3055
@keshavbajaj3055 4 жыл бұрын
too many ads..
Reference Data Member In C++
13:58
CppNuts
Рет қаралды 10 М.
Friend Function | Friend Class In C++
16:26
CppNuts
Рет қаралды 26 М.
ОБЯЗАТЕЛЬНО СОВЕРШАЙТЕ ДОБРО!❤❤❤
00:45
Alex hid in the closet #shorts
00:14
Mihdens
Рет қаралды 17 МЛН
Should I pass by const reference or by value?
10:45
The Cherno
Рет қаралды 101 М.
Bit Fields In C & C++
20:36
CppNuts
Рет қаралды 21 М.
Inline Function In C++
17:45
CppNuts
Рет қаралды 30 М.
Initializer List In C++
7:19
CppNuts
Рет қаралды 26 М.
Constant Members in Class | C++ Tutorial | Mr. Kishore
20:04
Naresh i Technologies
Рет қаралды 54 М.
Const correctness in C++
10:02
Code for yourself
Рет қаралды 2,8 М.
Template In C++
10:36
CppNuts
Рет қаралды 32 М.
Rust and RAII Memory Management - Computerphile
24:22
Computerphile
Рет қаралды 222 М.
every good programmer should know how to code this data structure (its easy)
21:08
ОБЯЗАТЕЛЬНО СОВЕРШАЙТЕ ДОБРО!❤❤❤
00:45