Structures, Unions & Enums in C++ | C++ Tutorials for Beginners #14
Вставка
- Опубліковано 7 вер 2024
- Download the best IDE for C, C# and C++: bit.ly/WholeTo...
►Source Code & Resources: codewithharry....
►This video is a part of my C++ playlist: • C++ Tutorials In Hindi
►For Doubt Solving, Brain Storming Sessions & guaranteed replies, join the channel membership here: / @codewithharry
►Click here to subscribe - / @codewithharry
►Checkout my English channel here: / programmingwithharry
Best Hindi Videos For Learning Programming:
►Learn Python In One Video - • Python Tutorial In Hin...
►Python Complete Course In Hindi - • Python Tutorials For A...
►C Language Complete Course In Hindi -
• C Language Tutorials I...
►JavaScript Complete Course In Hindi -
• JavaScript Tutorials I...
►Learn JavaScript in One Video - • JavaScript Tutorial
►Learn PHP In One Video - • Learn Php In One Video...
►Django Complete Course In Hindi -
• Python Django Tutorial...
►Machine Learning Using Python - • Machine Learning Tutor...
►Creating & Hosting A Website (Tech Blog) Using Python - • [Hindi] Web Developmen...
►Advanced Python Tutorials - • Intermediate/Advanced ...
►Object Oriented Programming In Python - • Object Oriented Progra...
►Python Data Science and Big Data Tutorials - • Python Data Science an...
Follow Me On Social Media
►Website (created using Flask) - www.codewithhar...
►Facebook - / codewithharry
►Instagram - / codewithharry
►Personal Facebook A/c - / geekyharis
Twitter - / haris_is_here
11:52 , it is not garbage value , but it is the ASCII code of 'c' i.e. 99 , if we use 'd' then it will show 100
its just in cases of char , for others it shows garbage values
you are right bro
Thanks for informing us 🔥
but bro the cout statement shows m1.rice so it's garbage value only
check now at 12:04
idk why? You make such good content and people enjoy the free stuff without even hitting the like
is that so hard.
I feel sorry man....
btw awesome content. nowhere to find such good ones
gazab ki baat ye hai ki there are some ppl who have disliked this video...
i dont know about others but i smash like at the time of clicking the video
@@cs29harshazad22 me also bro
@@cs29harshazad22 usss
pura dekte vi ho kya?
Harry Bhaiya, I just got to know that you are an alumnus of IIT Kharagpur and I am also a 3rd-year undergraduate student of the metallurgy dep at IIT Kgp. As you know, Our placements are knocking at the door, so I came into your channel since I had a very poor interest in coding. But now, I am bound to do it for the placement purpose and tbh you have instilled the motivation for coding into me by creating such amazing programming language tutorial videos through your youtube channel and that too for free of cost. I will forever be indebted to you, bhaiya. Thank you so much
Hello! I'm a fresher of EECE Dual this year :) Very excited to go to the campus
@@ahwabanmukherjee5065 Me too :-)
I'm a freshie at NIT ROURKELA CSE :)
IIT ni to NIT hi shi :)
@@deceptivedawwg1111
hey ....since i also started learing c++in my 3rd year...i was curious to know if you got the placement.(i am worried that i started a little late , that's why i was asking)
Thanks bhai, best explanations!
TIP : Enum is short for enumerate, meaning to allot a number. Another way to understand enums :D
what is the use to enumerate
@@adityagurjar3371 You can allot a number to (enumerate) each item to make it easy to access
🔴 5:49🔴All Shubhams unite😂😂
Big fan harry bhai💛❤️
@Elon Manuel Bad acting guys 😃🤣🤣🤣
@@pranavajay5528 exactly
I am💙
Hello there
Esa lag rha hain Jese Harry bhai ne yhe course C sikh kr aye logo ke liye banaya hain. Kyunki Harry bhai ne C language ke course me ekdam detail me padhaya hain. Lekin C++ course me Harry bhai ne jaldi jaldi padha diya.
ha exactly. SO I learnt structure,union and enumeration from another channel completely and easily
@@kushal6065which one?
harry.salary = 1200000...( thode or laga lete hain) 🤣🤣
👍👍
abhi km h
same yhi dakh ky comment krny aia tha lol
Km hai mere liye fir bhi koi baat nhi chla lenge Ghar 😂😂 nice Harry sir. 👍
@@nikhilrawat3959 me @12000 ,gazzab bezzati hai
16:00 Very Much Detailed Pinpoint and in depth Analysis of Enum by 0 & 1 Test
Day-10
completed upto Tutorial-14
Date-12/12/2022
Time-22:32
Topic-Structur_Union_And_Enums
thank you harry bhai
Very good video, one correction -- 12:00 - the "99" what you are getting is the ASCII value of "C" as the value is overwritten. It is not a garbage value... very minor correction :)
rice is there in cout then howcome 99 or the ascii value of car is appearing even it wins
@@gauravmak2394 the value "c" is assigned to rice as harry says but as the DATA TYPE of rice is "int" so it will give the ASCII value of "c".
if u want to check change the DATA TYPE of rice to "char". it will give you "c" as output....
RIGHT........
@@ashutoshyadav9382 But the value 'c' was assigned to car , then how come on printing rice we are getting ASCII value of 'c'?
@@thesmartone6601 because the data is saved in same space those 4 bytes are interpreted in different way for union this way it saves space
at 14:27 this is not any bug in code runner extension, it's a feature that you can run partial code. When you select some code in the editor and run it using code runner extension the selected part of the code gets executed. You can turn off this feature in the settings.
Yes, you are right..
You are a person that regular or alternate day upload your videos ..You are doing very well..great job bro
Hi Harry highly appreciated, I am from Los Angeles and your tutorial helped me crack the interview at apple. I learned C++ in 2 hours. Class and pointers that all they asked. By the it will be very helpful if you can create tutorial on bubble sorting, swapping, Fibonacci, algorithms for an interview it will be great help. In all the interviews in USA all tech companies they ask, Array, Arranging, Descending, Fibonacci, Bubble Sorting, Swapping algorithms that it.
you understood hindi ? nice
really they asked you array , bubble sorting Fibonacci , swapping . I studied this in school.
harry sir , I noticed one thing in yourr most of the videos ,you always used a name rohandas , who is rohan das, can u pls explain 😁😁
Bachpan ke langotiya yaar hai...
Rohan das mere coaching ka topper tha
Abhi IIT kgp mai hai😂
@@bibekray5874 Kia tumlog jante ho... Harry bhai ka Asli nam.....?
@Rajat Nahata sach me ? 😳😳😳
🆂︎🅰︎🅷︎🅸︎ 🅷︎🅰︎🅸︎ 🅼︎🅰︎🅸︎🅽︎🅴︎ 🅱︎🅷︎🅸︎ 🅳︎🅴︎🅺︎🅷︎🅰︎ 🅷︎🅰︎🅸︎🤔🤔🤔🤔🤔🤔
3:14 , 120000000 months jo kam hai mere liye fir bhi kam chala lenge 🤣🤣
Kam isliye hai kionki usme tax bhi bharna prega n....
@@GaneshKumar-qs9kn kitna bhi bharna pade 6 clole milenge na
@@ankitkushwaha633 haa haa bilkul milenge bs hr mahine koi bank ya fir kisi bahut Amir aadmi Ko lut lo...
Fir 6 crore nhi blki 15-20 crore milenge
@@ankitkushwaha633Toh fir toh haary ko hi lutna padega
@@GaneshKumar-qs9kn 😂😂😂😂😂😂😂😂😂😂😂
At 11:46 , that is not a garbage value. In unions memory locations are shared among many variable and at a time only one of the variable can be accessed. When you defined the character 'c' as the newest variable then, it will show correct output for car, but when you output rice which is actually an integer, then it (character c) will be type converted to an integer(with the help of ASCII values).
Wahi to bola ki overwrite hojati hai uski value😶
My name is Shubham
Name common
Personality unique🤣🤣
Yeah bro✌✌✌
Lol even gautham is a common name ;-(
@@gauthampracharya9592 are u guys kidding?
Sir,first of all thank you for providing us your lectures for free,it's been really helpful for students like us.I had a small query about the books or online platform to practice questions on python along with your videos as I want to learn python to an expert level but confused from where to practice the questions with goes along with your video tutorials,Thank you.
class 11 ,12 ki sumita arora ke questions krlo bhot hai
Codeforces join karlo mast probs hai vaha.
python complete hua?
Your explanation style is really great and your sound always seems familiar.
Thanks for making our path easier.
Im very happy 😌 when you take variable names or employees name Shubham. In c language course also there is Shubham Shubham 🤭 and hear also Shubham
Bhai mera name bhi shubham I'm very happy kii. Harry bhai in variables mein shubham name Ke rhe hai.aisa LG rhaa ki real mein Harry bhai. Mujhe pdaa rhe ho ki shubham aisa Kr vaisa krrr. Mujhe boht Acha lgta haiii. Keep it sirr. We lv u sirr. ❤️❤️❤️❤️❤️❤️❤️ May God Bless uuuuuu
3:15 ... 🤑 per month aur kaya chaiye
120000000 rest after paying tax😁😁😁😁
14:25 Here you're running the code by selecting some code that's why it is giving error I think it is not an code runner error. Thanks❤.
12:00 Its not a garbage value the newly declared variable overrides previous variable's memory location hence it converts to int ascii 'c'=99.
A noob code:
#include
using namespace std;
int main ()
{
int i;
int marks[4]= {28,30,35,48};
do{
cout
in the structure variable the total size wont be 9 byte, it will be 12 because of structure padding.
plz explain more
5:52 Shubham is none other than our legendary "BEAST BOY SHUB"
True😃
sir your teaching method is too good .but ,please give easy examples which we can understand or life friendly.
I am really learnt from this lecture
14:30 sir vo error isliye aaya tha cuz you ran a program after selecting some portion
Yes. Dude, You are right.
PER COMPILER TO FILE KO COMMPILE KERTA HAI TEXT KO NAHIN
11:50 it wasn't garbage value, it was ASCII code of 'c' bcz rice variable is of integer datatype
No that was char Data type check again
@@taimoorgamerz1560 you should recheck brother, rice is an integer type variable
very nicely explained all the concepts. love you bro. keep teaching us.
bhai thank you so much, because of your easy method of explanation i am able to understand c++ and apply it in the college syabus, once again thankyou and love your work and tutorials keep it up man
That 99 is not a garbage value. That is the ASCII value of 'c'.
Thank you sir for providing such a great lecture. Hat's off you
Bhai ae video me etna maza aya ki mene apni comedy videos ki list me dal diya or jab bhi mood kharab hota he me ye video dekh leta hu bhai
Bhai aap bahot hi acha kam kar rahe ho
Thanks harry bhai
If notes are available then upload in this series
Your notes are very helpful
Check the description
@CodeWithHarry not sure but at 11:45 when we run the program it doesn't give the garbage value but it gives the ascii value of 'c'.
or ma UNI jata hu BSCS krny kuch pallay ni prta to apka lecture dekhta hu sb smjh a jati ha Love from Pakistan ❤
5:51
Harry bhaiya, Mai hu shubham.
😄😄😄
5:48 Yes it indeed a common name .In my batch there are three Shubham including me.
Thanks Harry , now I can easily play with structures.. 😇
#include
using namespace std;
int main(){
int i;
int marks[5]={23,24,25,26,27};
cout
I love his videos , i m blessed that i could find this channel awesome teaching i love it these videos are helping me to prepare for my placememts n the best part is that i m enjoying watching his videos n yeah after all it is free so thats the best part n i recomment you all to watch all his tutorials i m currently watching web development n c++ and from my personal experience as i have tried other platforms also but i found this the best among all ❤️❤️❤️❤️
Inserts *okay*
Around 12:00 ,while explaining union, the value of 'c' (99) is not garbange but ANSCII
Thank You!
11:50 it is nor garbage or random number. If you notice, the 99 is the acci code of 'c'
Challenge Accepted!
int main(){
//arrays with while loop
int maths[5]={12,23,34,45,56};
int j = 0;
while (j
5:56 mai bhi hu shubham , bhaiya aapka dost. thank you for this course.
Write a C ++ Program. We have a day-to-day record of USD price in PKR for last 100 weeks. Find the week, which has a highest variation in PKR, while a base price is 160Rs = 1 USD. Also, find which week has the highest average USDprice
Sir Please Solve The Problem
To get the converted currency value we will multiply our float variables basic conversion values with the dollar amount entered by the user.
Python series me ajj Maine health management ka project comment kiye hai check pls and reply
thanks bhaiya I'm shubham jaiswal🙂🙂🙂🙂
Thank you, for good explanation. However, at 11:50 of video, the output value is not a garbage, it's the ASCII value of letter 'c'.
06:14 use of typedef in cpp
Kindly Ans it!
Sir asa ho skta ha enum ma kay lets ma khe pa 1 lekhu to waha pa 1 pa jo b stor ha let's breakfast stor ha to kaaya hmm uske value Get kr skty ha????
I think m1.rice = 99 was not a garbage value. Since rice is of integer type, it is showing ASCII value of 'c' stored in m1.car.
Music in end gives me different vibe :)
Thank u harry bhai
please bring exercise fast
12:30 ,enum
error in ur code by code runner is a feature not a bug that occurs because u run code by selecting a portion of code, in this case ; code runner pass only those selected line to compiler to compile and run that's why it gives error because it not pass any info about main function or header files only those selected lines
5:50, Subham at your service 😉😊
Mera v naam le liya harry bhai ne dil khush ho gya😂
Thanks sir for free provide lucture c++🙏🙏🙏🙏🙏
10:12 . umm.. it actually takes 12 bytes.. because, considering a char takes 1 byte and int takes 4 bytes.. a memory block which is grouped in 4 cells (4 bytes) each.. what happens is.. the first block of memory stores 1 int.. 2nd block stores a char in the first cell of the memory block.. now the remaining 3 cells of memory is unused but the memory cant store one float. so what the compiler does is that, it stores the float in the next block (wasting the 3 memory cells in the block that is storing char..
every video of yours deserves a like.
🙂
no need to write struct everytime in c++ for defining employee data type it is required in c everytime but in c++ we can just write "employee harry;"
Hey we can also use typedef in c
yeah correct
I searched about harry and real name is harris ali khan . A successful coder and many other achievements
5:51 Yup its me
UPSC mein puchenge?
@@VishalMaharathy kya???
Hiiii..harry..plz if u can help. I want to ask if I did my course with u but also want to get a certificate of it .how can i get it. Is there any site through which after giving a certain test i will be eligible to get a certificate
Challenge accepted and done for all 3 loops:-
#include
using namespace std;
int main(){
int i=0;
int CarNumber[]={2364, 3621, 3732, 1738, 2774};
cout
harry vai, in child hood: e code runner ki galti he😂😂( after getting error while running code)
harry vai, future me🤠: code ko select karke mat run karo, ek tempcoderunner file generate ho jayega, or select kiya hua part hi run hoga😎
Watch 3.03 to 3.16 🤩💥 kya bol diye sir
Harry sir has some special obsession towards rohanDas...😅😅😅
BTW, thanks for everything. You are literally like God 🙏 for me ... And I think for everybody who cannot afford paid tutorials. Thankyou again.🙏🙏
#include
using namespace std;
int main()
{
int a;
cout
Thanks I know hindi now apart from c++
//How I solve this problem in C++? When I wants to take Input from user its not //take the full book name with space, code was written in the "input" function
#include
#include
using namespace std;
struct book
{
int bid;
char bname[20];
float bprice;
};
book input();
void display(book);
book input()
{
book b1;
cout
In union code
m1.car='c';
Output : 99 because of his ASCII code
Harry Sir can't we use arrow operators in C++ for initializing just like we did in C??
5:53 I M Shubham😌🙌
you covered important topics very fast
awesome video... but how to implement these concepts?
// C++ program to illustrate the use
// of the unions
#include
using namespace std;
// Defining a Union
union GFG {
int Geek1;
char Geek2;
float Geek3;
};
// Driver Code
int main()
{
G1.Geek1 = 34;
// Printing values
cout
Harry sir , your video clear concept and understanding point and helpful video...thank U so much
m1. rice is printing ASCII code of char c and not garbage value.
Sir plz textseract se OCR kaise banageye in python . Plz help sir.
I tried many times but it will not install. Properly.
Help sir pdf or image conversion ocr mn kaise banaega
I m also Shubham😃.
Watching this tutorial after learning c language from Harry bhai.
7:13 important type def
Amazing ...Finally I got this concept
Thanks for videos harry sir ,
& My name also shubham
what is use of this structure union and enum??
Harry Sir I have a doubt ,
Can we declare the structure both outside and inside int main() or only outside??
you can declare at both place inside or outside
bhaiya i already know struct and typdef struct as i came from learning c programming
@CodeWithHarry It doesn't print garbage value. It prints the ASCII value of c at 11:45
Nicely Explained ....From Pakistan
Thank you bhaiya ❤️
Harry Bhai is best
union wala example bhut karab tha 😂
Aap hi sikha do bhai aake😊
harry bhai at 11:49 'c' ascii value is 99 so i think it prints the ascii value and not a garbage value reply me if i am right or wrong
harry bhai ek advance level pe bhi bna do. sabhi log jo is course ko advance level pe chahte ho is comment ke reply thoko taaki harry bhai apna collage ko beat kre ,because there is harry bhai is codeing ke jeetu bhaiya
you are awsome haary bhai
thankyou for c++ i learn daily