My Rules of understanding pointers:- '&' - this will return an address of any variable or things. '*' - this will dereference an address 'int *' - this will make a pointer variable 'variable_name' - this will return value of a 'variable_name' Extra:- swap(a,b) - Call by value swap(&a,&b) - Call by reference
any data type with star will make a pointer variable which can be used to address a memory location containing data of same data type as pointer@@herohera3497
*a++ karne se 2 hi aa rha he par *a += 1 karne se kaam de raha he aur 3 aa rha he, koi agar comment padh raha he to please bata do ye kyun ho raha he please.
@@ujjwalrockriser Dekho! Hum pointers address store karne ke liye use karte hai! So Jab tum address ko baghaoge i.e. *a++ karoge toh tumhara address next jagah par point karega jaha par kuch nahi hai. and jab tum *a+=1 karte ho tab address nahi increment hota hai, tab a par joh element hai usme 1 add hota hai! bcz jab hum *a++ karte hai tab memory address +2 se badhta hai, and jab hum *a+=1 karte hai tab woh element me 1 add hota hai. Samjhe?
@@ujjwalrockriser *a++ ki jagah (*a)++ try krke dekho, mera *a++ se nhi hua tha lekin brackets se kaam krgea,... ab bina brackets k kaam naah krne ka kaarn to meko bhi smjh nhi aaya, aapko smjh aaye to btaana
The point is we can't increment the pointer directly as *a++; It'll still print a=2 but using (*a)++; gives the incremented value It is somewhat similar to BODMAS rule. We need to dereference the pointer a then increment it Thank me later!
*a++ karne se 2 hi aa rha he par *a += 1 karne se kaam de raha he aur 3 aa rha he, koi agar comment padh raha he to please bata do ye kyun ho raha he please.
@@ujjwalrockriser are bro aisa isliye hai kyunki *a++ karne pe '++' operator ki precendence zyada hoti hai '*' se to vo address ka increment kar deta hai phir uss increased address ko dereference karta hai jisse apna original a same hi rehta hai iss issue ko solve karne ke liye apan ko bas (*a)++ ye likhna hai jisse pehle dereference ho phir increment
I don't know why people hate this kind of videos when someone is working so hard doing animation, writing the script, notes, editing the videos etc...etc... for your sake! Why can't we appreciate their work which has a huge impact on our society!!!
brother you are absolutely right, but also try to understand that if you are an absolute beginner, then did you understand? a big NO, so that's why some beginners didn't liking it!
@@harshhingu3082 stock management, seminars in diff collages, affiliated marketing and much more... Our aman bhaiya is all rounder 😎 Their annual income is 7Cr (some plus students were discussing this in comments session)
a BIG Thanks to Aman SIr & there Team !! Such a Great Efforts for student's who can't afford colleges or classes without showing any add's between the video
In my opinion, you're the best teacher on Apna College! ( No offense to other teachers, everyone's doing a great job, it's just my personal opinion, I am a slow learner)
If anyone is facing any problem, this can be because ++ has equal precedence with the * and the associativity is right-to-left. You can use ++*a or (*a)++ to specify the order of evaluation.
The point is we can't increment the pointer directly as *a++; It'll still print a=2 but using (*a)++; gives the incremented value. *a++ - Post Increment Operator, it first assigns the value and then increases the value later on. If we use ++*a - Pre Increament Operator, then it increase the value first and then assigns the value later on. So on using ++(*a) will give you the correct answer. Thanks !!
*Program to Increment variable using Pointers: #include using namespace std; void increment(int *x); int main() { int x = 2; increment(&x); //Pass by Reference cout
One more easy Way to call #include using namespace std; void Swap(int &a,int &b){ int temp = a; a = b; b = temp; } int main(){ int a = 3, b = 5; Swap(a, b); cout
Program to Increment variable using Pointers:- #include using namespace std; void increment(int *a){ (*a)++; } int main(){ int a=2; increment(&a); cout
A much simpler approach #include using namespace std; void swap(int& a, int& b){ int temp = a; a=b; b=temp; } int main() { int a=2; int b=4; swap(a,b); cout
No you can't use *ptr = &a as it is different. In Int *ptr , *ptr is no a variable only ptr is a variable. U can also write it as int** ptr. Int* is not integer data type, it is a integer type data type for storing address of a int variable.
19:00 apne wnha addresses bheje hain pointer variable k is liy argument variable wnha pointer type k honge to accept the address coming from function call.
I apologize for any confusion, but the program you provided is an example of 'pass by address,' not 'pass by reference,' as it's important to use the correct terminology in programming.
void swap(int &a, int &b) { int temp = a; a = b; b = temp; } int main() { int x = 5; int y = 10; swap(x,y); return 0; } Just put & sign before variables declaration to call by reference. ENJOY ......🤘
last one solve : #include using namespace std; void increement(int *a) { *a++;} void swap (int *a, int *b) { int temp = *a; *a = *b; *b = temp; } int main() { int a = 2 ; int b = 4; int *aptr = &a; int *bptr = &b; swap(aptr,bptr); cout
Are didi after 3 years of coding today i understood why i use & in scanf () in c And that switch from call by value to call my reference was pretty smooth Thank you apna kaksha team ...i love you guys
We can't directly increment *a++ because it follows bodmas rule. Here ++ has more precedence than * operator, So it does not update the value. To update the value the use (*a)++ .😀😀
My Rules of understanding pointers:-
'&' - this will return an address of any variable or things.
'*' - this will dereference an address
'int *' - this will make a pointer variable
'variable_name' - this will return value of a 'variable_name'
Extra:-
swap(a,b) - Call by value
swap(&a,&b) - Call by reference
Thank you so much!!
char* can also make pointer variable.
any data type with star will make a pointer variable which can be used to address a memory location containing data of same data type as pointer@@herohera3497
@@herohera3497 char *
Pointers Concept - 0:10
Pointer Arithmetic - 4:10
Pointers and arrays - 6:29
Pointer to pointer - 11:00
Passing pointer to function - 12:55
*a++ karne se 2 hi aa rha he par *a += 1 karne se kaam de raha he aur 3 aa rha he, koi agar comment padh raha he to please bata do ye kyun ho raha he please.
@@ujjwalrockriser Dekho! Hum pointers address store karne ke liye use karte hai! So Jab tum address ko baghaoge i.e. *a++ karoge toh tumhara address next jagah par point karega jaha par kuch nahi hai.
and jab tum *a+=1 karte ho tab address nahi increment hota hai, tab a par joh element hai usme 1 add hota hai! bcz jab hum *a++ karte hai tab memory address +2 se badhta hai, and jab hum *a+=1 karte hai tab woh element me 1 add hota hai.
Samjhe?
@@ujjwalrockriser *a++ ki jagah (*a)++ try krke dekho, mera *a++ se nhi hua tha lekin brackets se kaam krgea,... ab bina brackets k kaam naah krne ka kaarn to meko bhi smjh nhi aaya, aapko smjh aaye to btaana
@@sanyamratreja5457 bhai ye comment ke liye tarash gaya tha
@@shreyaschavhan5522 achha to ye baat he
Thank you bro
The point is we can't increment the pointer directly as *a++;
It'll still print a=2 but using (*a)++; gives the incremented value
It is somewhat similar to BODMAS rule. We need to dereference the pointer a then increment it
Thank me later!
Thanks Bro....
Thank you so much
thanks bhai bhot der se pareshan tha iske liye
thanks buddy!
thx
This has become a part of my daily schedule
*a++ karne se 2 hi aa rha he par *a += 1 karne se kaam de raha he aur 3 aa rha he, koi agar comment padh raha he to please bata do ye kyun ho raha he please.
@@ujjwalrockriser call by reference dekh lo aa jayega smz
@@monu_7712 samjha nahi
Same Problem
@@ujjwalrockriser are bro aisa isliye hai kyunki *a++ karne pe '++' operator ki precendence zyada hoti hai '*' se to vo address ka increment kar deta hai phir uss increased address ko dereference karta hai jisse apna original a same hi rehta hai
iss issue ko solve karne ke liye apan ko bas (*a)++ ye likhna hai jisse pehle dereference ho phir increment
I don't know why people hate this kind of videos when someone is working so hard doing animation, writing the script, notes, editing the videos etc...etc... for your sake! Why can't we appreciate their work which has a huge impact on our society!!!
brother you are absolutely right, but also try to understand that if you are an absolute beginner, then did you understand? a big NO, so that's why some beginners didn't liking it!
@@akash- grammar pro max ultra op bro
@@akash- i understood it tho
ua-cam.com/video/5FsIa4Mp3ho/v-deo.html
ua-cam.com/video/QTaiF8N6i3Y/v-deo.html
Why you remove all adds we don't want to learn by making anyone financially weak please bro you can add adds and also sponsership
dont worry about his finances he manages it well enough.... not being a hater of him ,, subscribed him for a long time
@@devplays3200 what are the other things he does to earn money do you know.I am just asking
@@devplays3200 bro I am just saying him that there is no need to compromise at all no one is getting angry for any add
@@harshhingu3082 stock management, seminars in diff collages, affiliated marketing and much more... Our aman bhaiya is all rounder 😎
Their annual income is 7Cr (some plus students were discussing this in comments session)
@@shlokhinge3179 he doesn't charge any penny for seminars, don't spread rumors
Sach me ammman sir pagal ho gya hoon me padh ke aisa content koi nhi dega paise le ker bhi love you sir💕🤘😊
Hmm
Hitler reacting to IIT-JEE RESULTS -- ua-cam.com/video/EioB3UK6IRM/v-deo.html
ua-cam.com/video/5FsIa4Mp3ho/v-deo.html🙏🏻
#include
Using namespace std;
Int swap(int &a,int &b){
Int temp ;
Temp = a ;
a = b ;
b = temp ;
};
Int main(){
Int a = 5 ;
Int b = 10 ;
Cout
Noo
@@pavansai1895 and why ?
This video's spoken accent is so strong in Indian English that it detracts from learning.
a BIG Thanks to Aman SIr & there Team !!
Such a Great Efforts for student's who can't afford colleges or classes
without showing any add's between the video
clg mein samaj nhi aaya par hyaa pe smj aaya actually jab live code example dete hai taab smj ata hai thanks so much
In my opinion, you're the best teacher on Apna College! ( No offense to other teachers, everyone's doing a great job, it's just my personal opinion, I am a slow learner)
If anyone is facing any problem, this can be because ++ has equal precedence with the * and the associativity is right-to-left. You can use ++*a or (*a)++ to specify the order of evaluation.
this should be pinned. now i realize how many actually code and how many simply watch the video.
Thanks bhaiya.
Thanks a lot Buddy.😄
this was much needed...thank you so much pal!
@@unnatisingh7612 Thank you so much for going out of your way and commenting this. I was having a really bad day and it really cheered me up!
@@sourabhjain8102 it was my immense pleasure to hear that!!...
Keep going buddy !
The point is we can't increment the pointer directly as *a++;
It'll still print a=2 but using (*a)++; gives the incremented value.
*a++ - Post Increment Operator, it first assigns the value and then increases the value later on.
If we use
++*a - Pre Increament Operator, then it increase the value first and then assigns the value later on.
So on using ++(*a) will give you the correct answer.
Thanks !!
When God come to help poor students ❤️
@Raunak Singh lol, usko free nahi piracy bolte he. Thats why vo telegram par he aur ye YT.
@Raunak Singh where?
@Raunak Singh kaha free course h plzz help 🙏🙏
ua-cam.com/video/5FsIa4Mp3ho/v-deo.html
"Aya samajh me thoda thoda was so sweet mam"🤗
haha true
*Program to Increment variable using Pointers:
#include
using namespace std;
void increment(int *x);
int main()
{
int x = 2;
increment(&x); //Pass by Reference
cout
Bro smj nhi aaya
Don't get for what I was searching for... but really impressed by your way of teaching its awesome Ma Sha Allah 👍🏻💫
One more easy Way to call
#include
using namespace std;
void Swap(int &a,int &b){
int temp = a;
a = b;
b = temp;
}
int main(){
int a = 3, b = 5;
Swap(a, b);
cout
Please post at least 2 videos per day if possible 🙏 Either way I am blessed to get such amazing tutorials for free
ua-cam.com/video/PbcUrsLTDF4/v-deo.html
Haath bhi jodte hoo aur bhik bhi maangte hoo🤣🤣🤣🤣
@@debiprasannapattanaik8294Apne Guru ke samne hath jodke bhik mangne me kya hi bura hai
no one never ever explained something like the way you explained hats off 👌💯
This channel deserves more subscribers ❤️🔥
Pls provide us some extra questions sheet for each lecture .
By the way you and your team is doing great work .
STAND UP WE NEED {PYTHON}
Hitler reacting to IIT-JEE RESULTS -- ua-cam.com/video/EioB3UK6IRM/v-deo.html
@@QWERTY-135 jo mil raha wo le le phle 🤣🤣🤣🤣🤣
ua-cam.com/video/5FsIa4Mp3ho/v-deo.html
ua-cam.com/video/5FsIa4Mp3ho/v-deo.html
Your videos are extremely helpful thanks a lot to everyone who gave their time, effort and money to make these videos ❤️.
Is playlist mai dsa bhi krwaya hai?
we want SHARDHA DEDI in this video to teach this topic please please
THUMBS UP WHO AGREE
Dii even though other teachers are good too but i understand each topic the most when you explain it. thank you so much
Meri pyari sister.... I am totally jelesh... Your voice because, your voice is amazing😘😘😘😘 Shreya singh
Thanks ma'am, for covering the complete pointer in one video!
Pointer to pointer to pointer to pointer....
Inception at max level
this is the most amazing explanation I have ever seen on pointers.
thanks team
Program to Increment variable using Pointers:-
#include
using namespace std;
void increment(int *a){
(*a)++;
}
int main(){
int a=2;
increment(&a);
cout
thanks bro
thanks
Very useful video it clear my doubt of pointers
amazing explaination mam, thankyou soo much .
i think first time i really understood the concept calling by-value and by-reference .
Acchaaa
Di mza aa gya , now the speed of teaching is very good. I'm loving it. Thanks di and Aman bhiya ❤
12:32 didi boht sundar hai aapki hadwriting....meri itni dangerous hai ki 5 marks for extra dark handwriting kat jaate the mere school mein
Shruti didi always explain is very good 👍❤️❤️
This is what kind of lessons I always want.
Great video, first time in my life I understand the concept of pointers. Thank you so much :D
Pehli baar pointer ka video dekho gee toh pehli baar hi samjhoge naa
Thnku dii bhut acha smjhaya apne 👍👍
A much simpler approach
#include
using namespace std;
void swap(int& a, int& b){
int temp = a;
a=b;
b=temp;
}
int main() {
int a=2;
int b=4;
swap(a,b);
cout
Pdhane k sath sath communication sounds bhot accha h
this is prolly the best explanation for pointer
Best video ever on pointer
didi your the best teacher in the world lots of love ❤❤❤❤❤❤❤❤❤❤❤🙏
Thanks for ur hardwork. The way u explained it's the easier way .
#include
using namespace std;
void increment(int *a)
{
++*a;
}
int main()
{
int a=2;
int *ptr=&a;
increment(ptr);
cout
but still answer is same ?? ya change??
Awesome Work by Aman dhattarwal sir .
Great brother for self taught students
Hitler reacting to IIT-JEE RESULTS -- ua-cam.com/video/EioB3UK6IRM/v-deo.html
i am seriously wanting this video and a great thanks to all the team and didi for this video ♥♥
This is really good leacture gjb💥🔥
#include
using namespace std;
void swap(int *a){
(*a)++;
}
int main()
{
int a=5;
swap(&a);
cout
Loved her work
Like👍👍👍
One notable point is that
1. int *ptr=&a;
2. *ptr=&a;
Here line 1 and 2 is not same thing
Right
@@jimcheriyan1801 what's the difference?
@@it41tanmayaron26 1 is correct bcuz we hav t o declare pointers type too
No you can't use *ptr = &a as it is different.
In Int *ptr , *ptr is no a variable only ptr is a variable. U can also write it as int** ptr.
Int* is not integer data type, it is a integer type data type for storing address of a int variable.
@@TricknologyHub ok, so 2nd is wrong
The code for pointers with explanation is here:
#include
using namespace std;
int main(){
int a = 10;
cout
void keyword is used when the function has no return value
thankyou di❤❤ finally i understand pointer
Ma'am ek number samjhaya
#include
using namespace std;
void increment(int a){
a++;
}
int main(){
int a=2;
increment(a);
cout
she sounds so clear to me!
didi kya mst explain kiya he(i mean mem).🔥🔥
Printers are the variables that stores the value of other variables
kya mast padhaya hai didi......
Cout
Ab samaj aaya pointers. Sahi bolu pointers aur undefined behaviour sabse confuse karni wali cheze hai C++ mai.
Thanku soo much Aman Bhaiya ji 🤗 & Ma'am ji
i used to always get confused with pointers. not anymore. good video
How to understand the content in English? Subtitles aren't available!
Thank You so much bhaiya...and whole ApnaCollegeTeam
19:00 apne wnha addresses bheje hain pointer variable k is liy argument variable wnha pointer type k honge to accept the address coming from function call.
Wow what a great explanation
Hats off Aman bhaiya
Hitler reacting to IIT-JEE RESULTS -- ua-cam.com/video/EioB3UK6IRM/v-deo.html
Thanks Aman for the quality content and Thanks for the crystal clear explanation Urvi. 👍
finally, understood the pass-by reference concept functionality.
Pointer Concept: 0:10
Shukriya bhaii hum tau dhund hi nahi paa rahe tha XD
😂@@arafatkhan5489
One of the best explanation !
Really very informative video. Thank you for putting the efforts :)
Advance 5 million congratulations
I apologize for any confusion, but the program you provided is an example of 'pass by address,' not 'pass by reference,' as it's important to use the correct terminology in programming.
Massive shout out to Aman bhaiya. At some point in life, I'd love to meet you
This is the amazing bole to next level🤘
Thank you didi you explained it very beautifully.
void swap(int &a, int &b)
{
int temp = a;
a = b;
b = temp;
}
int main()
{
int x = 5;
int y = 10;
swap(x,y);
return 0;
}
Just put & sign before variables declaration to call by reference. ENJOY ......🤘
very well Mam! amaing and effective learning video.
good work sister ...your work is good .i impress it . yo u take deeep working
Samjh me aya thoda thoda.❤❤
Excellent explanation! 👍
Give credits to the person teaching in the description as well. Great Video!
last one solve :
#include
using namespace std;
void increement(int *a)
{ *a++;}
void swap (int *a, int *b)
{ int temp = *a;
*a = *b;
*b = temp;
}
int main()
{ int a = 2 ;
int b = 4;
int *aptr = &a;
int *bptr = &b;
swap(aptr,bptr);
cout
In few years competition in coding will be like jee .Credit goes to Online educators for providing quality content for free .🙂😁😎
really? and you consider that a good thing?
@@aryanoberoi Obviously good(for doers) , sad for fellow lazy peoples
ua-cam.com/video/5FsIa4Mp3ho/v-deo.html
ua-cam.com/video/QTaiF8N6i3Y/v-deo.html
Love you, kaksha❤️
Hitler reacting to IIT-JEE RESULTS -- ua-cam.com/video/EioB3UK6IRM/v-deo.html
At 12:58
we can modify and output value of a without using pointers like this
#include
using namespace std;
void increment(int a) {
a++;
cout
The best part of the video is "Handwriting ko ignore karna"😆
Bhaiya your videos are awesome , always motivate me ❤😇
Thanks for this wonderful video
I am confused only mam's lectures are more explainable to me than sir's lectures but overall lectures are awesome
Thank You Ma'am ☺🙏👍
Are didi after 3 years of coding today i understood why i use & in scanf () in c
And that switch from call by value to call my reference was pretty smooth
Thank you apna kaksha team ...i love you guys
Don't worry your writing is too good👍
Pointers Arithmetic - 4:10
❤❤❤❤ loved as always
Hitler reacting to IIT-JEE RESULTS -- ua-cam.com/video/EioB3UK6IRM/v-deo.html
Thank you Sir and Mam.Please make a video on types of pointers and diversified applications.
Bro In which year you are currently?
Thank you Aman sir ☺
We can't directly increment *a++ because it follows bodmas rule. Here ++ has more precedence than * operator, So it does not update the value. To update the value the use (*a)++ .😀😀
Thanks man