I had seen videos ranging upto 1 hour to understand stucture pointer and arrow operator , your 8:39 minutes were the ones to explain....... Thanks a lot........
Hi, Nicely explained. Thanks a lot. I have a question. How does pointer to a class or a struct works ? I mean, I know that a pointer to a string is the address of the first character and computer can read the continuous memory blocks until it finds the null character. So how does this works in the case of a class pointer or a struct pointer ?
here "name" is the name of the character array. array name is a constant pointer. once it points to a memory address, we cant change it. it will always point to that memory address. if you write ptr -> name="Anil" you are actually trying to store the address of character A in the pointer "name" which is not possible because it is a constant pointer. So we use strcpy function to change the value stored in the memory location pointed by "name" hope this helps :) -learninglad
here "name" is the name of the character array. array name is a constant pointer. once it points to a memory address, we cant change it. it will always point to that memory address. if you write ptr -> name="Anil" you are actually trying to store the address of character A in the pointer "name" which is not possible because it is a constant pointer. So we use strcpy function to change the value stored in the memory location pointed by "name" hope this helps :)
I'm not angry bro. some people just open the video hit like then comment and leave. they don't watch the video or that topic is not at all needed for them. I just don't think the comments like "the first comment, first like" etc add any value.
@@LearningLad Sorry...im learning cpp from you and ur tutorials are the best on youtube becuz u go prom beginner to advanced...I didnt think of learning c becuause maybe i thought it is an old programming language but u would be happy to see people commenting
I just love to see people commenting on my videos. But not the comments like " First view, First Like, First Comment " etc Anyways thank you for chatting about this. Have a great day :)
I had seen videos ranging upto 1 hour to understand stucture pointer and arrow operator , your 8:39 minutes were the ones to explain....... Thanks a lot........
Glad my video helped you
Keep learning
Pointer to Struct is actuakky a fairly complicated topic. But your simplistic way of explanation made it pretty simple. Thx a lot.
Pleasure
Very simple explanation. Thanks brother.
You are welcome
Thanks for the video. Helped a lot in understanding about this operator.
Glad it helped
These Tutorials are so Efficient 😀😀😀😀
Thank you
That was a pleasure to listen to. Thank you. Made it very clear and simple to understand. Great work!!
Thanks a lot. explained so easily with simple examples, perfect!
You are welcome!
thank you very much I was looking for this arrow operator . you earned my sub
Glad I could help
Thanks for sharing, you video teachs me a lots.
Glad to hear that!
Why are you saying to dislike come on man no one can dislike it was the perfect explainationnn thankssss dudeee!!
Thank you
Just wanted to get some genuine opinion
Thank you, very well explained!
You are welcome!
excellent tutorial.
thank you :)
Hi, Nicely explained. Thanks a lot. I have a question. How does pointer to a class or a struct works ? I mean, I know that a pointer to a string is the address of the first character and computer can read the continuous memory blocks until it finds the null character. So how does this works in the case of a class pointer or a struct pointer ?
thank you sir
Most welcome
Crystal clear explanation
thankyou sir very clear explanation! -new subscriber :)
Welcome!
Thank you so much, sir 😊.
Most welcome
Means --> arrow operator and (*__). Member both are for same use right ?
awesome tutorial
You are really great
Thank you
Sir so there is no difference between -> and * atall? They both have the exact same purpose.. ?
There is no difference between -> and (*__). You need the star AND dot (don't forget the parenthesis) if you decided not to use the -> operator
Can we change the name "Anil" like
ptr->name="Name";
or it is an error;
here "name" is the name of the character array.
array name is a constant pointer.
once it points to a memory address, we cant change it.
it will always point to that memory address.
if you write
ptr -> name="Anil"
you are actually trying to store the address of character A in the pointer "name"
which is not possible because it is a constant pointer.
So we use strcpy function to change the value stored in the memory location pointed by "name"
hope this helps :)
-learninglad
@@joeyyeet2970 thanks u cleared my doubt
Thank you.
Pleasure
Thank a lot for your great tutorial
pleasure :)
Thanks a lot sir
Most welcome
Instead of age if we apply operations on name it gets error lvalue required
ptr -> age = 200 works but why ptr -> name = AnilD ; doesn't work ?? We can change int value but not string .. how to change that ?
here "name" is the name of the character array.
array name is a constant pointer.
once it points to a memory address, we cant change it.
it will always point to that memory address.
if you write
ptr -> name="Anil"
you are actually trying to store the address of character A in the pointer "name"
which is not possible because it is a constant pointer.
So we use strcpy function to change the value stored in the memory location pointed by "name"
hope this helps :)
@@LearningLad thank you very much
Which IDE you are using?
vs code
Which compiler do you use sir?
Gcc
@@LearningLad thank you sir
Thank u so much
Most welcome 😊
thanks
Pleasure
What if we use
Void main()
Instead of,
Int main()
cpp requires it , c doesnt , it indicates sucefull compilation
should return 0
The reason why I watched this video is
Because of thumbnail.
I was wondering about => operator
But it wasn't there
Is it a clickbait? 🤔
Or by mistake?
yes it was a mistake
it should be -> operator
sorry about that
i made thumbnail 2 days after the video.
really sorry
Thank you anil shetty
most welcome :)
whatever anything I do or did or anything or before or after
or did not watch the previous about you know what I mean but I know it from I will keep it secret
whatever anything I do or did or anything
666th like🤗
Ok im not interested in C programing rather than cpp but i just came hoping for 1st comment haha
what you get if u commented first
@@LearningLad Dont be angry sorry..i was not angry i was just telling that i hoped for first comment
I'm not angry bro.
some people just open the video hit like then comment and leave.
they don't watch the video or that topic is not at all needed for them.
I just don't think the comments like "the first comment, first like" etc add any value.
@@LearningLad Sorry...im learning cpp from you and ur tutorials are the best on youtube becuz u go prom beginner to advanced...I didnt think of learning c becuause maybe i thought it is an old programming language but u would be happy to see people commenting
I just love to see people commenting on my videos. But not the comments like " First view, First Like, First Comment " etc
Anyways thank you for chatting about this. Have a great day :)