Great video, thanks, Jenny. So, there are two pointer operators: * and &. The & is a unary operator, called “Address of” or “Reference operator” that returns the memory address of its operand. For example, j = &i; assigns the address of i into j. This address is the computer's internal location of the variable in memory. It has nothing to do with the value of i. You can think of & as returning "the address of". Therefore, the above assignment statement can be expressed as "j receives the address of i". The second pointer operator, *, called “Value at address” or “Dereference operator” or "Indirection operator" is the complement of &. It returns the value located at the address that follows. For example, if j contains the memory address of the variable i, k = *j; copies the value of i into k. Hope that was helpful. :)
Yesterday onwards I am seeing your videos on C programming. Because you I get so much clarity on some topics in c and I got confidence for my further examination
according to the above block of code: int a =10, b = 9; int c; int *p,*q; p=&a; q=&b; // the pointer 'q' declaration here means that the address-of 'b' is assigned as // the value of q c = *q; // here is the declaration of c to *q or &b. This means that using the indirection // operator or dereferencing * operator: the value of the variable is accessed. // in this case the variable is 'b' *p = 20; // this will manipulate the value of the variable which p points to: 'a' // 'a' variable was initially 10 now value will be '20' printf("c = %d",c) // the output will be exactly the value at variable 'b' printf("a = %d",a) // the output will be the current assigned value to *p which is 20 🏑🏑i hope this was helpful to someone to understand better the output of c.
Nice explanation, Just wanted to add in the line c = *q; it basically means that c = 9; because dereferenced q is pointing to the value of b which is 9.
@@neelirahul7892 Nope, a = 20. Look again at the second original printf statement: printf ("a = %d", *p) , 10 It's an instruction to print "a =" value of *p. It was written to show you that this is so, even though it isn't formally declared. a = *p is inferred from p = &a: a = 10, p = &a p points to the address of a (&a). *p points to the value held at &a. &a is the location that holds the value of a. *p points to the value of a. a = *p *p = 10 Both a and *p are the same data stored in memory at &a, so cannot be two different values. As long as p = &a, for *p = 20 to be true it must override a = 10. If you don't understand this you can accidentally overwrite your variables when using pointers.
I'm in the middle of doing my CS course, and this helps me a lot on understanding pointers (which apparently is a very hard subject that even the veterans hates). She's a great teacher.
c=&q which means c=*(&b) value at memory location of variable b. *p = 20 this means *(&a) value 20 will be stored at variable a and will pointer will point to address of memory a
@@nandinil8723 p is storing the address of a, that is it has a direct access to whatsoever value that is stored in a, so when you dereference p, what you get is the direct value of a, so dereferencing p and giving it a value of 20 is the same as updating the value stored at the address of a, which initially was 10 to the new value, which is now 20. I believe you understand it now?
mam waited for pointers for a long time thanks for start uploading mam!!.please post all videos as soon as possible mam.please try to upload 2 videos per day mam.Thank you mam.
Mam c=9 only As you told us to comment on C=*q So it must be 9 In the program while you were running you have given C=*p Which will give a value 10 I got it mam Thanks
For second question it's not clear whether ma'am had declared the value of a as 10 or 20. If you declare value of a as 10 then the output will be 10, if you declare it as 20, output will be 20. (run the code on your PC to verify)So value of a cannot be updated using *p. Whatever the value of a is declared first that will be printed. And for the third one it will print address of a in hexadecimal form
@@alaharianuhya9523 we used there indirectional operator that is * which prints the value of 'a' at address of 'a' (As we already declared above that 'p' stores the address of the variable 'a')
@@kushpreetbakshi4828 hello. Value is coming out to be 10 when I run it in VS code. And after this I also print Printf("%d", *p) ; So value is coming 20 there. How come?
c=9 and a=20 because the address of a is stored in p and we are changing the value which is stored in that address so value of a=20; and the address of p strores address of a
value of c = 9 because c is initialised to hold the value of the pointer q(which houses the address of b), which turns out to be 9. Hence, value of c printed would be 9. In case 2, the value of the address p holds (*p) is modified in memory to 20. The address p holds is of variable and since *p is modified, it means a has been modified (or corrupted). Hence the value of a printed would be 20. In the last case, p would print the address of the variable a, didn't change throughout the program.
1-- c=*q; this will assign value of memory address that is stored in q so c will become 9 2-- a=10; *p=&a; *p=20; this time value 20 is assigned to a variable and its orignal value is overwritten by this
in case of printf("c= %d", c); the address of pointer q is printed in integer format. next incase of printf("a= %d ",a); value of a willl be printed that is 10.
what I understood I if we initialize int a=10; int *p; p=&a; *p=44; printf("%d", a); then it will print a=44; i think here we are changing the value stored in a through pointers i.e if p is having address of a the *p says value stored at the address means if we initialze *p =44; means we are initializing value to a.
Today is March 1st which is your birthday wish your a very happy birthday🎂🎂the best programming teacher on youtube
Ur birthday is also come on 1st March!
c = *q;
*p = 20;
Output would be c = 9 and a = 20. While p = the address of a in a hexadecimal form
Mam you deserve the word "Teacher" !!!!
ua-cam.com/video/oWtizowZYBc/v-deo.html
Perfectnaa!
world teacher not word
She is a teacher indeed lol!
yes
Great video, thanks, Jenny. So, there are two pointer operators: * and &. The & is a unary operator, called “Address of” or “Reference operator” that returns the memory address of its operand.
For example,
j = &i;
assigns the address of i into j. This address is the computer's internal location of the variable in memory. It has nothing to do with the value of i. You can think of & as returning "the address of". Therefore, the above assignment statement can be expressed as "j receives the address of i".
The second pointer operator, *, called “Value at address” or “Dereference operator” or "Indirection operator" is the complement of &. It returns the value located at the address that follows. For example, if j contains the memory address of the variable i,
k = *j;
copies the value of i into k.
Hope that was helpful. :)
Excellent explanation
Yes Thank You 🙏❤️ Nice Explanation 🙏❤️👏
@@SandipBhattacharya Thanks helped me personally 😄
Best teacher of computer ever. Keep it up👍
C= 9
a= 20
p=ADDRESS OF A IN HEX FORM
you summed it perfectly...but why have to written c
Here value of a is incorrect
@@universe449 why??
They didn't declare a value of C then how will you assign the value of C is 9?
Could you please explain to me, why p will be the address of a (in hex form)? why specifically in hex format?
Best teacher I have ever seen in my life😃😃🙏
Kaha se ho??
Best teacher of computer ever.
Yesterday onwards I am seeing your videos on C programming. Because you I get so much clarity on some topics in c and I got confidence for my further examination
according to the above block of code:
int a =10, b = 9;
int c;
int *p,*q;
p=&a;
q=&b; // the pointer 'q' declaration here means that the address-of 'b' is assigned as
// the value of q
c = *q; // here is the declaration of c to *q or &b. This means that using the indirection
// operator or dereferencing * operator: the value of the variable is accessed.
// in this case the variable is 'b'
*p = 20; // this will manipulate the value of the variable which p points to: 'a'
// 'a' variable was initially 10 now value will be '20'
printf("c = %d",c) // the output will be exactly the value at variable 'b'
printf("a = %d",a) // the output will be the current assigned value to *p which is 20
🏑🏑i hope this was helpful to someone to understand better the output of c.
Nice explanation, Just wanted to add in the line c = *q; it basically means that c = 9; because dereferenced q is pointing to the value of b which is 9.
Yea: exactly.. thank you.
c = 9
understood . thanks
Ans
C=9
a=20
P= address of a in hexadecimal format
Value of a might be 10 only as ma'am has written %d then a and in the starting of prog value of a is 10.
here a=*p,
so the value of a is 20 only
here we are assigning new value to *p so the value of a is 20 ...
correct me if I'm wrong 😶
*p= 20; i.e value at address of a(here 1000) so *(1000) = 20 or simply a= 20
@@praveensamuel8083 bro a=*p is not declared at all
How can you say that it's out put is 20 .
It's 10 for sure
@@neelirahul7892 Nope, a = 20.
Look again at the second original printf statement: printf ("a = %d", *p) , 10
It's an instruction to print "a =" value of *p. It was written to show you that this is so, even though it isn't formally declared. a = *p is inferred from p = &a:
a = 10, p = &a
p points to the address of a (&a).
*p points to the value held at &a.
&a is the location that holds the value of a.
*p points to the value of a.
a = *p
*p = 10
Both a and *p are the same data stored in memory at &a, so cannot be two different values. As long as p = &a, for *p = 20 to be true it must override a = 10. If you don't understand this you can accidentally overwrite your variables when using pointers.
Mam I like your way of explaining the subject to students 👌, you are the best programming languages teacher for me......
I'm in the middle of doing my CS course, and this helps me a lot on understanding pointers (which apparently is a very hard subject that even the veterans hates).
She's a great teacher.
@@john_avernia hey which year??
As we taken c=*q which means *q gives the value of b. Because q=&b;
*q = value of b. Therefore the c=b;
C= 9.
shiny rao u rocked !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Right
Yes
Yes
You are wrong
Thanks mam me 5 din se smjh nhi pa rha tha pointer apka video dekha smjh agya
very beautiful teacher.
truely. that itself keeps us hooked 😅
c=&q which means c=*(&b) value at memory location of variable b.
*p = 20 this means *(&a) value 20 will be stored at variable a and will pointer will point to address of memory a
Absolutely, if we use *p or *(&a).
Best one❤🎉
The printf("C = %d, c) will give us 9, the printf("a = %d", a) will give us 20 and the printf("%x", p) will give us 0x8000.
correct
@@heysuraj-ik1rd Thank you...
How pls explain a and p values
@@nandinil8723 p is storing the address of a, that is it has a direct access to whatsoever value that is stored in a, so when you dereference p, what you get is the direct value of a, so dereferencing p and giving it a value of 20 is the same as updating the value stored at the address of a, which initially was 10 to the new value, which is now 20. I believe you understand it now?
@@nandinil8723 While p is the hexa-decimal value of p, that's the hexa-decimal value of 20.
🎉🎉🎉😊😊😊 super excited about the topic learn more about the t
Mam you are amazing
I always watch only your video when i don't understand in my college
You are better than my college teacher
Mam whenever you teach us everything is FINE!
Best teacher of computer in india
mam waited for pointers for a long time thanks for start uploading mam!!.please post all videos as soon as possible mam.please try to upload 2 videos per day mam.Thank you mam.
She got me through my bachelor in computer science more than any teacher at Uni
mam thanks lot your teaching style is very awesome slowly slowly helps me to understand all the topics
thanks a lot mam you are best
Ma'am you are literally the best teacher ever!!!!
No one can beat u in being the best teacher ever for C programming.
Mam c=9 only
As you told us to comment on
C=*q
So it must be 9
In the program while you were running you have given
C=*p
Which will give a value 10
I got it mam
Thanks
C=*q
That means it should print value of 'C' but where Is C value
For second question it's not clear whether ma'am had declared the value of a as 10 or 20.
If you declare value of a as 10 then the output will be 10, if you declare it as 20, output will be 20. (run the code on your PC to verify)So value of a cannot be updated using *p. Whatever the value of a is declared first that will be printed.
And for the third one it will print address of a in hexadecimal form
a) c = *q , then value of c is 9
b) *p = 20 means value at (&a) is 20.
c) value of p is address of 'a' in hexadecimal form.
Thanks bro for this easy way
Can you pls tell me how the value of a is 20
@@alaharianuhya9523 we used there indirectional operator that is * which prints the value of 'a' at address of 'a'
(As we already declared above that 'p' stores the address of the variable 'a')
Thank you soo much mam ❤️😀
I have understood clearly.
best teacher ever !thank you so much
*p=20; which means value of a will be overwritten by 20.a=20;
a = 10
P = 1000EF( in hexadecimal form)
C = 9
A will be 20 bro change kar di hai val. A ki pointer se
@@kushpreetbakshi4828 hello.
Value is coming out to be 10 when I run it in VS code.
And after this
I also print
Printf("%d", *p) ;
So value is coming 20 there.
How come?
your method of teaching is very good, thank you
Thanks ma'am your video clear my all doubt ☺️
Answer
C=9
a=20
P=it store the address of other variable in hexa decimal form...
Crystal clear mam thanks
15:29 answer is 9
16:18 for value of a answer is 20 and for value of p answer is 1000
exactly hexadecimal value of p is 1000 only....
y bcoz here p have address of variable 'a'...
condition: P=&a
C = 9
A= 20
P = hexadecimal number
if you suddenly open 15:38 it looks like b=a lol, in that case value of C would be 10 which I thought, because it looked like that to me lmao
9
It's very useful mam thanks for this information
ua-cam.com/video/oWtizowZYBc/v-deo.html
Today is mam interview and these video is so beneficial for me💜
Best lecture ever seen..
Happy Birthday mam ❤
New to the channel. I like your style of teaching. Keep up the good work!
ua-cam.com/video/oWtizowZYBc/v-deo.html
Nice teaching
The value of a now is override by 20 output is 20 for a value mam
Thank you very much mam now concept is very much clear.
ua-cam.com/video/oWtizowZYBc/v-deo.html
Best teacher in the world❤🩷💛
c=9 and a=20 because the address of a is stored in p and we are changing the value which is stored in that address so value of a=20;
and the address of p strores address of a
One of the great gift for Indian students..
I am already a software developer. I don't know what I am doing here . I just came to see you everyday .
I know what you are doing here...
@@timjoyalle318 please enlighten me 😀
@@FunandLearn2512 You're here for her beautiful mind!
@@timjoyalle318 yes correct .
my favourite teacher and first choose of CS
Thank u very much mam.💪💪👍👍🙏🙏❤❤
ua-cam.com/video/oWtizowZYBc/v-deo.html
value of c = 9 because c is initialised to hold the value of the pointer q(which houses the address of b), which turns out to be 9. Hence, value of c printed would be 9. In case 2, the value of the address p holds (*p) is modified in memory to 20. The address p holds is of variable and since *p is modified, it means a has been modified (or corrupted). Hence the value of a printed would be 20. In the last case, p would print the address of the variable a, didn't change throughout the program.
16:19
Answers are:-
c=9;
a = 20;
p = &a; (i.e. 1000 or assume in hexadecimal as per the example).
You are right 👍
Thank you for lecture
1--
c=*q; this will assign value of memory address that is stored in q so c will become 9
2--
a=10;
*p=&a;
*p=20;
this time value 20 is assigned to a variable and its orignal value is overwritten by this
hyderabad secunderabad jenny madam zindabad...
ua-cam.com/video/oWtizowZYBc/v-deo.html
Haappyyy Birthday Mam!🎉 Grateful for ur videos❤
in case of printf("c= %d", c); the address of pointer q is printed in integer format.
next incase of printf("a= %d ",a); value of a willl be printed that is 10.
@sampath sam hey
a= 20
p= address of a in hexadecimal form
c=9
Hi nikita❣️❤️
Mam aap bhout acha padhate hoo
Since, q is carrying the address of b, so *(&b) = b. So, the output will be 9.
Example of beauty with brain 🥰🥰
ua-cam.com/video/oWtizowZYBc/v-deo.html
thnks mam it was exam.time you cleared me before going to exam......and the exam was practical exam.🥲
Printf ("%x",p) gives adress of p in hexa decimal form
C = 9
a = 20
p = address of a ( hexadecimal number )
Thank you mam for uploading this.
ua-cam.com/video/oWtizowZYBc/v-deo.html
superb explanation madam
Now i can understand pointers
Better than our academic lectures..
hey army ..!
@@mohithar1110 hiiiii💜💜
Wow I can see army's every where 💜🥰
value of c == value of b and a becomes variable so it leaves 10 value and it will get new value that is 20 a=20 and p=20
Thanks a lot! Your class is helping me achieve the impossible
thank you maaam
Ma'am if possible, upload video fast.
Nice lecture 👍
Why can't Lecturers teach with passion like this? 🤦
Value of c is 9
Value of a is 10
Value of p is &a in hexadecimal
i like your video...thx ma'am
C=*q ,*q represents the address of b in which b value is present and print the value c= 9
Your class is awesome mam❣🥰
i found u finally 😇😇
very very thank you so much ma'am
q contains the address of b(q=&b)
*q contains the value of b=9
So c=9(c=*q(
Happy Birthday 🎉
Thanks mam alot😍😍😍😍😍😍😍
Thank you so much mam 🏵️🏵️🏵️... really greatful to you mam
best mam ever.❤❤
your classes are awesome 😎😎😎 mam
Thanks a lot Mam for this lecture!!!
Megh I love tou
c outputs 9
the value of a is 20
p prints the memory address of a in hexadecimal
15:28 *q=&b; here *q=9; then c=*q; so c will equal to 9
c=*q; since q stores address of b so the value at that address will be stored in c i.e 9
ankit and pulkit will remember forever
printf("c=%d",c); output is: 9
Value of c is 9
Value of a is 20
Value of p is the address of a which in our case it's 1000 but will actually be in hexadecimal form
Nice hair style Mam😍😍😍
ua-cam.com/video/oWtizowZYBc/v-deo.html
what I understood I
if we initialize
int a=10;
int *p;
p=&a;
*p=44;
printf("%d", a);
then it will print a=44;
i think here we are changing the value stored in a through pointers
i.e if p is having address of a
the *p says value stored at the address
means if we initialze *p =44; means we are initializing value to a.
value of a will get printed
the adress of p will get printed in another case
thank you soo much jenny madam❤
Her Eye contact 😘
Madam |G Thank You ""Good Job
ua-cam.com/video/oWtizowZYBc/v-deo.html
Mam your voice is so sweet . I feel sleepy