Call by Value & Call by Reference in C++ | C++ Tutorials for Beginners #16
Вставка
- Опубліковано 15 вер 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
Analogy of swap function is really commandable( song copy Bluetooth ,song use in Google drive)
Very True :)
true :)
@@sailendrachettri8320 bhai tum emoji thode is type ke lagao👉👉😊😊👈👈
@@srijanmukherjee3648 tum bhi bhai emoji is type ke lagao👉👉😊😊👈👈
@@fellincode2607 :)
Rohan Das has separate fan base 😍
😂😂
Lmfao 😆
#include
using namespace std;
void swap(int &x, int &y) {
int tem=x;
x=y;
y=tem;
}
int main(){
int a=5;
int b=7;
cout
Even i got it but i was thinking why he didnt say that ..Many approaches got me confused at the end
Sale chatgpt use kariya hai 😂
so helpful for me thanks
Bro now i feel the actual tough part of coding has begun....i start to feel the difficulty now...guess i will revise all the previous lectures before watching the next one
@@shubhsharma19 jee rank ?
@@shubhsharma19 bruh
@@shubhsharma19 😶 is it true ?...
@@shubhsharma19 why do you have to interfere and act cool.....can't you just motivate him instead of making fun of him.....
yes it has begun i will revise all the concepts before lecture 19
Sir this lecture is very conceptual and you tried your best to teach us in a simple way Hats off to you sir
You explained this concept with a superb analogy that any one wouldn't end up finishing this video having doubts in his/her mind regarding pass by value and pass by reference.
I loved the logic we used in this topic, it was probably the most complex one yet. Thank you Harry bhai for explaining it in such detail ♥
Aadhe ghante ki vid ke lie almost 1 hour lg gya samjhne me 😂
@@mayushi7792 konsi video ye vaali kya plzz batao.....
@@yashwalke 🤣
VARANASI SARALA IS A VB, THAT'S WHY SHE SAID EVERYBODY WORKS IN COMPUTER SCIENCE.
It's not the error of the code runner. It is actually a feature to run selected code by the cursor. It may be helpful in python.
This concept is very much needed in calling functions.
Thank you sir for clearing all the concepts.🙏🙏🔥🔥🤘🤘😇😇
13:10 swapping using c++ reference variables
@CodeWithHarry thanks for your nice videos on c++
imprtant to mention that swap() itself is a keyword to swap two numbers in c++;
it swaps two number without even creating a function.
bro sorry but this lecture is very confusing for me
Same 😢
Same yaar 2-3 dusre video dekhkar aaya hu fir kuch kuch smj aaya hai 😢
You should watch previous videos .
Don't worry it will take little time...on my request if you could please watch Call by Value vs Call by Reference in C programming by Harry Bhaiya, it may help you...there the topic is illustrated beautifully...
Everything take time and patience, so go through the process not results
Thank you so much bhaiya for clearing every topic in very concise way. And, i know as simple you are teaching in video is not as simple behind the video, so, i also appreciating your hard work in making such incredible videos. A lot of thanks and best wishes for you Bhaiya.
lmaoo the way he said "valueeeeeeee" at 4:33. love the tutorial tho
This video is a gem if you are having doubts in the concept of pointers
watched more than 6 times and understodd what sir is trying to teach
Aapke classes dekhne ko maza ata hai bhai.enjoy with learning..😍🤗comedy + teaching...😁fun learning..kabhi bore nahi hota hai ..Thank you so much bhayya.
18:10 , rough.cpp . I really wanted to see what's inside rough.cpp at the beggininh of video. Harry bhai ne meri man ki baat sun li. I will call you "Guruji" from next time. Thank you so much for doing all this for us.
Call by Value // i.e, the very first function in this video --> int sum(int a, int b)
Changes made to the formal parameter inside the function have no effect on the actual parameter, Call by Value is used by default.
Yeah ..
yah right...
point to point explanation with perfect example , covered in minimum time , hats off harry bhai 🔥🔥
you really deserve more likes and views
learning C helped me a lot i completed this playlist in 1 week
Or main 2 din (approx 14 hours) main 😂
@@P0K0 gajab meko 4 days lage
Same in 9 days
@@anuragtiwari9793 Op bro
@@shifuji-7154 am just the beginners so am learning 2 lecture a day.
Thanks bhaiya it is really helping to brush up the skills and learn new things and the snippets part was really unique .
elvish bhay ke aage koi bol sakta hai kya??? elviiiiiiis bhaaaaaay
Lovish also😂
I also like to know him..😂
Gandhi k chacha ka ladka!
Harry bhai ka langotiya yaar.
Harry bhai ke chacha hai jo filaal abhi vidhayak mai hai
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
big thanks to you harry sir. bhai c++ ka sabse bada confusion dur kar diya aapne.👍
If any thing selected on vs code and if we run program then it will make tempcode file and show error . So be careful before compiling .
Thank u sir for your effort.
You videos are the only source for me to lern c++ and java in this lockdown.
Have you learn completely from this playlist I don't think this playlist for biegners
@@WILDfacts2.0 iam a beginner I'm in like 45th video of this playlist it's absolutely recommended for you
You are doing nice work bro kindly keep it up
the playlist is really so helpful👏👏, the concept is little bit hard but I would suggest you .... just go through the video twice and read the source code...you will surely understand the concept
17:25 It was some bit hard to understand. But I understood that.
Sir call by value nahi samjh aaya
Can you repeat this topic please sir 🙏🏻
@@bhavyanavyadancechannel8276 oh so call by value is jus using the part that does't worked while swapping is that call by value?
void swap(int a,int b)
..
int main(){
swap(x,y);
}
sir if you check source code & resources , you will find that in code snippet 2 result image is wrong as your data mention above result. please check you are brilliant teacher
yeah
harry bhaiya ... we can swap the variable using this also ....
int main(){
int a,b,x;
cin>>a>>b;
x=a;
a=b;
b=x;
cout
Thanks for clearing all my doubts and your analogy is amazing
Every time I watch a video from harry i first like and then watch. Obviously every video is awesome.
Very easy and clear explanations ... Thanks a ton
I'm really not able to understand this concept. Sir your videos are very informative and help a lot. But I'm not able to grasp this concept. Is there anyone who can please help.
break the code into steps may be it will help you
The first thing that he taught that value is not changed is basically the call by value...by which we can't change the actual value ...but then he taught 2 methods of changing it ...and we can change and that change of values of actual parameters by those 2 methods are basically the call by reference topic...
the examples given are commendable
@code with harry bhaiya aapne kafi difficult way mai bataya is topic ko hum direct bhi toh swap kr skte hian 3rd variable ki heip se
like:-
// #include
// using namespace std;
// int main(){
// int a,b,c;
// cout
isme function use nahi hue.
Thanks
11:19 so in short swap function se bas copy jaa rha hai isliye vaha to change ho jayega par main waale function mai values ka kuch change nhi hoga kyuki vo original hai lekin pointer waale se hum uska address le rhe hai to vaha jo change hoga uske address ki madad se yaha bhi changes ho jayenge
Am i right?
void swap(int* a ,int* b){
int* temp=a;
a=b;
b=temp;
}
int main(){
int a=3,b=4;
swap(a,b);
cout
Superb series for c++ .............such a nice explanation
Very confusing bro
Call by value - original value change nhi hogi. Address sai kuch lena dena nhi bs value ki copy jati hai .
Call by reference - original value bhi change hogi . Kyunki yaha value nahi jati balki uska address jata hai . Ismai usko value sai kuch lena dena nhi hota . Address mai jo value update hoga woh print krdega
Ge sir your lecture is very interesting and good method of teaching
THANK YOU SIR
Legends believe in harry bhai more than the other teacher.
great explanation harry bhai
Self referential note: this video is important
7:50 pe pointer ki jgh upr print kraa do values fir to swap ho hi jaengi
int main(){
int x =4, y=5;
cout
thank you bhai
I like your video
Sir.. i follow your channel. Of c++ , please upload.. frequently.. i request you sir
Great Bro Thanks
ty16😀
altho bhaiya, still i'm a lil bit confused in this topic cuz i'm learning it for the 1st time. still thnks bhaiya i hope with time i'll get used to it.🙂
Bro this concept of pointers and address is really conceptual
Thank you sir
I got confused... i studied and understood different than in this video.....And sound is also not clear.. Please make another video for this topic. BTW you are awesome..Your teaching technique is very good. @codewithharry please make another video in this topic.
good bro great
bahut hi sir unorganise way hai aapke illustration ka, you would be great if you will put some efforts in to polish your illustration skill.
I think he knows deeper in programming but he tells about a bit.
@@monu_7712 his teaching manner is so unorganised which make things difficult to understand and explanations always be in scattered form.
What are you doing bro?
8:45 sir here this will not swap values of x and y (actual parameters) and not a and b
That function will swap the value of a and b (formal parameters)
day-11
Tuttorial-16 done
hello
thank you so much, Bhai for this kind of teaching
thankyou bhaiya❤
10:20 mara demage ki file currupt hoo gi ha 😂😂😂par koe ni dobara dakhna par samjh aa gy.Thanks you
Sir apka video mey sob kuch thik hay, but ek problem hay- sob kuch ek sath dekha raha hey, to beginners der thora problem aa raha hay..
Turn on autosave in vs code . That might help in problem with code runner
Very hard it is
your videos are awesome but I can't understand this concept ok now should I move I ll watch this video again after completing course
is lecture ki zra bhi smjh nhi aye
So it means when we use call by value the swap function will not work and when we use call by reference then the swap function will work. right?
bhai please use dynamic inputs(like taking inputs from user)
Harry sir, code likh ke har baar dry run krke dikhao.
currect boss... your all the videos useful for me...............
Bro,one small doubt i request u to pls clear,
When u make swapReferenceVar(int &a,int &b)
To isme &a ya &b ka data type to integer nahi hai phir bhi ye ek hexadecial type nber ko int data type ke sath kaise accept kar le raha hai.
Thanks Harish bhaiya
17:10 I understood but bit tricky , new concept learned here , this was not included in C 15 Hrs tutorial.
Was hard to understand but managed to understand it perfectly by the end of the day😃🥲👍
Damm i understood in a Hour no cap 🙂🤞
harry bro...smjh nhi aya
what should i do....i am new to coding.
18:11 sound of realme notification Charge for promotion
Sir ye vid bilkul smkh ni aha.. Apne achanak se swap LA dia jiske bare me koi idea nhi tha Hume.. Plzz make another vid
Do watch some another 2 videos of this type and come back again to his video u will get a clarification.
Bhaiya,How to pass an array by call by reference???
Harry bhai mera to first tym me hi run ho gya . Is that a problem??
Thank you bhaiya ❤️
very well explained .
Great Sir!
#include
using namespace std;
int sum(int a ,int b);
int main(){
int a=4,b=5;
cout
Thank you.
thank you harry bhaiya for explaining clearly
Temp code runner error comes when you select a text and then click the code runner button
It will only run the selected text
So unselected any selected code before running the program
exactly!!
5:30 - swap ho raha hai , without using pointer
#include
using namespace std;
int sum(int a , int b){
int c = a+b;
return c;
}
int main()
{
int x=4,y=5;
//cout
It is more easy in python
Thanks harry bhai for these amazing series!
4:35 😂😂
Take Love From Bangladesh Harry Bhai ❤️
thanks bhai
at 8:50 if we dont add (&) with X & Y the code will still work.
This topic i didn't understood well,so please make a new video for this