Pointer types, pointer arithmetic, void pointers

  Рет қаралды 491,193

mycodeschool

mycodeschool

Күн бұрын

Пікірлер: 426
@darkseeven
@darkseeven 5 жыл бұрын
your 10 minutes of video is more valuable than 6 hours of my teacher lectures:))) Thumbs up
@mycodeschool
@mycodeschool 11 жыл бұрын
Hi bmgag19, You will have to acknowledge that people from different geographies would pronounce things differently. Even in a machine, Natural language processing does not happen through rules, it happens through statistical learning by training the machine on different accents. Larger and diverse the corpus, better is the natural language processing engine. In fact, standards and not strictly enforced in pronunciation. The most we can promise is being close to it. :)
@surajborekar2869
@surajborekar2869 5 жыл бұрын
Where are you sir?
@Zeus-fe3we
@Zeus-fe3we 5 жыл бұрын
@@surajborekar2869 I am sorry to say that this guy no longer in this world I exactly don't know what happened but he died he's IIt student. May god give peace to his soul. RIP... BEST TEACHER
@krusher9977
@krusher9977 5 жыл бұрын
​@@Zeus-fe3we big if true
@Prabhatkumar-ht3se
@Prabhatkumar-ht3se 5 жыл бұрын
@@Zeus-fe3we he is currently working in google
@juhanhossain7594
@juhanhossain7594 4 жыл бұрын
@@Prabhatkumar-ht3se no he died . around 4 years ago by a car accident :( his popular name is" humblefool ".Google it
@SyarifZapata
@SyarifZapata 7 жыл бұрын
one of the best teacher on internet. Thank you so much! can i buy you a coffee?
@mohamedessawey4192
@mohamedessawey4192 3 жыл бұрын
@@shailendrakumar3130 sad!!
@jasonzhang2643
@jasonzhang2643 3 жыл бұрын
@@shailendrakumar3130 Just learned about this. I watched many of his videos and get a good job at a tech company. www.freecodecamp.org/news/mycodeschool-youtube-channel-history/
@ShivamSharma-rq9ne
@ShivamSharma-rq9ne 3 жыл бұрын
That means a dead person is teaching us. F and rip
@tapasvipatell
@tapasvipatell 3 жыл бұрын
@@shailendrakumar3130 who is he? how he died?
@Simple_OG
@Simple_OG 8 ай бұрын
​@@tapasvipatell I think car accident
@msjaxp
@msjaxp 11 жыл бұрын
The most amazing lectures I have ever seen The pointers were a myth for me since I was a student from 10 years ago
@parthvatsal1
@parthvatsal1 8 жыл бұрын
I studied computer science in 2007 and I hated it because I never understood it. I wish your tutorials were there when I was a student. Maybe I would still have been in this domain.
@AbhishekKumar-yj3ix
@AbhishekKumar-yj3ix 5 жыл бұрын
its never too late for a computer science student !!
@omayma4921
@omayma4921 5 жыл бұрын
never too late
@wardenofthenorth-w5d
@wardenofthenorth-w5d 4 жыл бұрын
ntl man. hang in there!
@LousyPainter
@LousyPainter 9 жыл бұрын
Your awesome! What else can I say? You are a great teacher! Great teachers are a rare breed. Thank your Mother for giving birth to you! She deserves it.
@shivamverma9447
@shivamverma9447 4 жыл бұрын
Absolute masterclass displayed in these lectures. Made everyone's life easy.....
@vikku_19
@vikku_19 3 жыл бұрын
In c++, We have to typecast it back to integer otherwise it gives some weird output. int a=1025; int *p; p=&a; cout
@akshatmishra5786
@akshatmishra5786 2 жыл бұрын
Thanks, I was having a problem too (sorted now)
@carlpittenger
@carlpittenger Жыл бұрын
yep, he was getting 1 printed out because he was using the %d format specifier in the printf call which automatically converts the char to an int.
@kushagrasahu8289
@kushagrasahu8289 5 жыл бұрын
Clearly the best available lectures on KZbin for pointers. Hand down🙌🙌
@mycodeschool
@mycodeschool 11 жыл бұрын
Your feedback is taken. Thanks a lot !
@fangqingyu3158
@fangqingyu3158 11 жыл бұрын
Most in-depth videos on pointers I've ever watched! Thank you for clearing the mist for me :)
@chaynhungkhongkhet833
@chaynhungkhongkhet833 3 жыл бұрын
I'm here,I'm sophomore .Thank you so much for creating lectures like this. I heard stories of Animesh and Harsha .The value that you create remains forever.Thank you !!!!
@leoonair3598
@leoonair3598 5 жыл бұрын
The way you explain things are great. Like your voice, pace and using examples to give in-depth knowledge. Keep it going. Serving millions. Thank You.
@Slacker4o
@Slacker4o 10 жыл бұрын
Finally. I think i understand pointers
@mycodeschool
@mycodeschool 11 жыл бұрын
Hi Tushar, We just added two videos on pointers and multi-dimensional arrays in this playlist. Please go through them. They will help.
@mycodeschool
@mycodeschool 11 жыл бұрын
Jose, Finally , we have the merge sort video :)
@hitikagahalot4549
@hitikagahalot4549 3 жыл бұрын
No one is better than you sir, you are made for this. We want you back sir.
@stefanspinu8784
@stefanspinu8784 7 жыл бұрын
Dude, your tutorials are simply amazing! You totally changed my perspective about pointers - I'm so excited about the next videos that I'm going to watch today. Are you a teacher professionally?
@ly4422
@ly4422 4 жыл бұрын
You are a gift from the CS heavens! Thank You, your playlist saved my future!!
@mycodeschool
@mycodeschool 11 жыл бұрын
Congrats Hani !! You get a Kudos !! :)
@FernandoBasso
@FernandoBasso 10 жыл бұрын
sizeof is an operator, not a function. Great videos. I'm learning a lot from them. Thanks a lot and keep up the amazing work.
@mycodeschool
@mycodeschool 11 жыл бұрын
Thanks Loveuala, We will be adding more lessons in this series soon. Please stay tuned.
@thenishanth420
@thenishanth420 7 жыл бұрын
You are definitely the best professor in the field of C/C++. Salute to you :)
@Phantom1037
@Phantom1037 7 жыл бұрын
I don't know how to thank you for the great explanation. You dive very deep to explain the concept clearly. Thanks a lot.
@aventador1049
@aventador1049 4 жыл бұрын
One of the best on KZbin..
@omarfarouk2080
@omarfarouk2080 3 жыл бұрын
your English accent is clear and good, sir. Thank you for offering easy explanations
@yashtailor1543
@yashtailor1543 5 жыл бұрын
You don't know how much happiness you have given to us ❤, thanks man ❤❤❤❤❤❤
@amizan8653
@amizan8653 8 жыл бұрын
I really like your videos man, you go deep in understanding of what's going on while still keeping things really simple.
@herohera3497
@herohera3497 2 жыл бұрын
i like ur name
@mycodeschool
@mycodeschool 11 жыл бұрын
Because there is no information about the data type with a generic pointer. Depending upon the data type, different logic will be applied to decode the value. For example, char is only 1 byte, int is 4 bytes (typically) but its encoding in binary is different from double which is also 4 bytes. SO starting the address how many bytes should be looked at and how it should be interpreted depends upon the type.
@Brianmongo
@Brianmongo 4 жыл бұрын
Finally.. hands down the best explanation
@codestorywithMIK
@codestorywithMIK 8 жыл бұрын
I think this is the best video on pointers. Thanks a lottttttttttttttttttttttttttttttttttttttttttttttttt.
@thestarinthesky_
@thestarinthesky_ 5 жыл бұрын
You are by far the best teachers! I have learned a lot. I wish you could continue making more videos!
@thecuriousone12
@thecuriousone12 10 жыл бұрын
You are great in explaining! What at school seemed a myth, you explained it very clearly! Thank you so much, this will help me so much on my exam next Wednesday.
@bakxodgamer7607
@bakxodgamer7607 6 жыл бұрын
thnx for appreciation but alas he is no more
@VIKASHKUMAR-qt7pk
@VIKASHKUMAR-qt7pk 5 жыл бұрын
while(true) { cout
@shubhamraj2835
@shubhamraj2835 3 жыл бұрын
my computer crashed because of this code infinite loop
@magdam3961
@magdam3961 9 жыл бұрын
Amazing explanation! Everything is very understanble and clear especially for people without any programming experience!
@snehchauhan8507
@snehchauhan8507 4 жыл бұрын
The best video on pointers with all information conveyed in the series. 😇 Thank you so much 😀
@thomasscream4179
@thomasscream4179 7 жыл бұрын
Man you have real teaching talent
@masterchef8671
@masterchef8671 9 жыл бұрын
ur videos on pointers so far are so good !! Explaining in such a way that all topics are touched ..Thanks a lot for ur efforts, it has definitely paid off...Recommending this video for all my friends :)
@sa34898
@sa34898 6 жыл бұрын
Thank you so much I understood how a variable which is declared is stored in memory in binary form. I have been wanting to know this since I started learning C. Never delete this video. Thanks very much again!
@allenllewellynkra
@allenllewellynkra 4 жыл бұрын
This video alone was more valuable than my university CS course
@mycodeschool
@mycodeschool 12 жыл бұрын
Thanks Jose !! You are never too "demanding" :) Merge sort video is promised to you. However, we want to move on with lessons in a series , so we would like to do a whole playlist on sorting algorithms starting from bubble sort and selection sort till quick sort. It will take some time to script and shoot videos. Please send an email to mycodeschool@gmail.com and we will be able to help you offline till the time we do not have lessons on sorting. Thanks again for your kind words.
@ShopperPlug
@ShopperPlug 2 жыл бұрын
Excellent explanation. Spectacular video series in pointers for pure C.
@userhdza2248
@userhdza2248 3 жыл бұрын
you are really a great teacher short videos . examples . explaining the whole cycle as a unit what we see and what computer see at same time
@gnzeu4tpns91
@gnzeu4tpns91 6 жыл бұрын
this is great. you are good at explaining "complicated or over complicated" subject
@melodiegauthier
@melodiegauthier 10 жыл бұрын
thank you thank you thank you! (did I say thank you?) :)
@mycodeschool
@mycodeschool 10 жыл бұрын
You are most welcome melodie gauthier :)
@trilecao9014
@trilecao9014 4 жыл бұрын
This is the most fundamental lesson of pointer to be learned in C.
@mycodeschool
@mycodeschool 11 жыл бұрын
Thanks Jackie :)
@ibrahimgudratli6345
@ibrahimgudratli6345 5 жыл бұрын
Hello. I have a question. 07:11 you wrote printf("%d", p); is it correct? If we want to know address we should use "%p". I think that the number which you got from this, is not an address. Maybe it is just garbage value.
@ibrahimgudratli6345
@ibrahimgudratli6345 5 жыл бұрын
I understood :D
@shivamthaman7081
@shivamthaman7081 8 жыл бұрын
i wish u were teaching me in clg. such a great explanation ; deep,relavant and clear. thanks a ton sir. i avoided ques using pointers as they made me nervous but now i'm quite confident about it.
@ganshi1
@ganshi1 11 жыл бұрын
Brilliant concept clarity...Well done sir
@gemix3858
@gemix3858 6 жыл бұрын
No words, only claps for you ! Thanks Alot, Man !
@kritangnasingh5934
@kritangnasingh5934 7 жыл бұрын
Your videos are very easy to understand.
@jaskiratsingh2157
@jaskiratsingh2157 7 жыл бұрын
which IDE are you using ..
@AbhijatBiswas
@AbhijatBiswas 11 жыл бұрын
Loved the part where you type cast to the char pointer. Didn't know that! Cheers!
@AfhamAdian
@AfhamAdian Жыл бұрын
Best Video on The PLatform
@nikolajkapa2283
@nikolajkapa2283 8 жыл бұрын
Great depth and quality of material.
@FMUSAADTP
@FMUSAADTP 11 жыл бұрын
you are very helpful thank you ! i'm learning a lot From this Channel keep Do it Awesome !! :)
@mycodeschool
@mycodeschool 11 жыл бұрын
Yeah sure ! we will be adding more videos in this playlist. Stay tuned by subscribing to the channel :)
@DanielDeakin
@DanielDeakin 9 жыл бұрын
very helpful, made pointers actually make sense
@debadritadutta2308
@debadritadutta2308 3 жыл бұрын
Just a small doubt of a beginner Im sorry if its silly....If we typecasted to char why did we use %d and not %c while printing?
@aptitudepointiit-bhu5358
@aptitudepointiit-bhu5358 2 жыл бұрын
Here our motive is not to print any character value, we are just checking, what exactly happens if any character pointer points to an integer value, instead of an integer pointer. So, we got to know that the character pointer will only read the value at 1 byte, and thus ignore the remaining 3 bytes, and returns an incorrect value, unlike the integer pointer that takes all the 4 bytes into consideration. This is why we use the pointer of the same data type as the value, it is pointing to. Hopefully, this is helpful. ✌
@mostafayasin1
@mostafayasin1 6 жыл бұрын
Thank you very much , those tutorials helped me in my job interview :)
@naeroforceofficial
@naeroforceofficial 8 жыл бұрын
I really like those tutorials, you repeat some informations and by doing that i always remember all things :)
@oshogarg5215
@oshogarg5215 6 жыл бұрын
Awesome video.. No one explained like this ....
@pradhoshss8281
@pradhoshss8281 4 жыл бұрын
Your lecturers are awesome:)
@sharathnb
@sharathnb 6 жыл бұрын
U r super amazing, fantastic, fantabulous, superb, running out of adjectives. Trust me, I've been looking for this type of tutorial, concepts with simple examples.
@amitkumarbalaantu845
@amitkumarbalaantu845 5 жыл бұрын
First of all, thanks for making such amazing tutorials. I have a question on 10:28. You said de-referencing and arithmetic operations are not possible in void pointers. But I tried to do arithmetic operation in my void pointer by adding 1 with it. The code compiled and p0+1 gave output value 1 more than p0. I stored a integer pointer value in p0.
@jamiewrithe8367
@jamiewrithe8367 4 жыл бұрын
very concise and excellent examples. Thank you!
@alijumc
@alijumc 4 жыл бұрын
Thanks for the clear explanation. I watch similar stuff many times but fails at some point because some detail was not deeply presented. There is some level of sympathy in your explanation that covers the bottom levels and the time span, that fit even the most poisoned brain from the past aka college, middle school, and other learning platforms.
@LilTea1000
@LilTea1000 10 жыл бұрын
Thank you very much,you have an incredible talent,you are so good at explaining.
@srinathkumar1452
@srinathkumar1452 8 жыл бұрын
Excellent series of videos!
@kiku_to_herself
@kiku_to_herself 4 жыл бұрын
Summary - int a=10; int *p=&a; p is pointer to integer &a and p will give the address of a variable (suppose its 2000) *p(value at p) and a will give the value of a that is 10. (p+1) will give 2004 as output coz will give the next address which will be after 4 bytes or 2 bytes , depending how much memory integer is taking , you can find it by using - sizeof(int) *(p+1) will give the value stored at next 4 bytes which is mostly garbage value Pointer are strong type because we not only store address but use them for dereferencing as well MSB is sign bit int *p; char *po; po=(char*)p; //This is called typecasting Void pointer- void *pi; pi=p; We can only print address Can't dereference or perform arithmetic operation
@mycodeschool
@mycodeschool 11 жыл бұрын
Thanks Ooatii :)
@giorgos6576
@giorgos6576 6 жыл бұрын
There are no words to describe your word . The least i can say is amazing . The only thing that u should have mentioned in that if p is pointer then printf(" %d %p , p , p); prints first the adress in decimal , and the second in hexadecimal .
@lakhdeepsingh5883
@lakhdeepsingh5883 7 жыл бұрын
Indeed the explaination presented are easy to understand
@hupa1a
@hupa1a 4 жыл бұрын
Great series man!
@leixun
@leixun 4 жыл бұрын
*My takeaways:* General pointer type - void, it can't be de-referenced and do any pointer arithmetic 9:25
@jlecampana
@jlecampana 12 жыл бұрын
Great video! This is slightly out of topic, but, Could you please do the Merge Sort video Next? I may sound too 'demanding' now, but... In case you do said video, Could you please show us the recursive version? (Maybe use the CLRS book Pseudo-code to base off your real C++ Implementation?) Thanks in advance! and... I'm truly enjoying every minute of all the videos you upload, Good job!
@mycodeschool
@mycodeschool 11 жыл бұрын
No you need to use asterisk. Its like char and char* are two different data types.
@GeorgeRodes1968
@GeorgeRodes1968 8 жыл бұрын
Excellent work! Much appreciated.
@raphaelmoreira1850
@raphaelmoreira1850 3 жыл бұрын
Sir, you are a genius.
@vishaljhaveri7565
@vishaljhaveri7565 4 жыл бұрын
I love you man! You are a freakin' awesome teacher!
@ivandrofly
@ivandrofly 9 жыл бұрын
Thank you so much ;)... best video about pointer I found so far
@DolaLado
@DolaLado 4 жыл бұрын
Excellent explanation, thank you.
@NinjaMan986
@NinjaMan986 8 жыл бұрын
Can the lookup table not tell the type that is stored at that adress? A valuable lesson you gave here.
@aadishdeshpande1343
@aadishdeshpande1343 5 жыл бұрын
4:46 - Correction, sizeof() is not a function it's an operator :)
@fanusgebrehiwet6286
@fanusgebrehiwet6286 5 жыл бұрын
Aadish Deshpande operators are functions
@ashutoshdwivedi3976
@ashutoshdwivedi3976 5 жыл бұрын
For C++, you have to cast again in integer while printing; cout
@rohitvishwakarma9261
@rohitvishwakarma9261 5 жыл бұрын
thanks bro
@rohitvishwakarma9261
@rohitvishwakarma9261 5 жыл бұрын
but bro why I'm not getting (int*)*(p0+1) value 4
@HumbertoFioravanteFerro
@HumbertoFioravanteFerro 8 жыл бұрын
Nice and concise explanation. Thank you!
@JackiePrime
@JackiePrime 11 жыл бұрын
thanks for the videos, very concise and clear. Better than my university :(
@hovhadovah
@hovhadovah 8 жыл бұрын
Very informative video, thanks a lot! I didn't know how data types were stored in memory. Interesting stuff :)
@fireinsidepower3648
@fireinsidepower3648 6 жыл бұрын
Seriously , this is great
@swapnilchhatre5845
@swapnilchhatre5845 5 жыл бұрын
Damn man! What explanation man! superb!
@psawyer871
@psawyer871 8 жыл бұрын
Excellent tutorials!!
@ozbjd
@ozbjd 9 жыл бұрын
I'm sorry, but I think there is a similar error in this video as there was in the previous video "working with pointers" regarding pointer arithmetic. Between 5:51 and 7:54 where you talk about printing the values of p, p+1, p0, and p0 + 1. What you are printing is the contents of those addresses, not the addresses themselves. The number of bytes difference between p and p +1 and p0 and p0 +1 will be determined by the type of machine and compiler you are using and is the number of bytes required to store a memory address on that computer. You can use the format printf("%p ", (void *)&p). You need to assign p+1 and p0+1 to variables to be able to print the addresses of p+1 and p0+1.
@iljafjorovs
@iljafjorovs 8 жыл бұрын
This video made my day!!!
@divyatunuguntla1472
@divyatunuguntla1472 9 жыл бұрын
Such a good explanation i ever hear sir, and very simple teaching methods. I thought that pointers means tragedy but you solved that tragedy very easily :P ;) :)
@supradipmondal609
@supradipmondal609 8 жыл бұрын
sir your videos are to good and too helpful for me.... and thank u soooooooo much.. i have seen other C videos but your videos are too understandable for me.... One thing i reqst to u tht please make some videos about funtions,,structrure and also file I/O... all C videos are there except tht..... i need it to learn...soo... thank u....
@computerscience8795
@computerscience8795 2 жыл бұрын
thank you for these amazing videos.
@vikashsinha588
@vikashsinha588 8 жыл бұрын
Thank You for such a ease example .
@gigachadkartik
@gigachadkartik 3 жыл бұрын
I learned so much from this video
@CODINC
@CODINC 8 жыл бұрын
Amazing tutorial!!! I finally got it!!!
@AmanSingh-zj7im
@AmanSingh-zj7im 11 жыл бұрын
Is it important to typecast any pointer with * sign ...?? for ex : p0=(char *)p; p0=(char)p;// is this possible??
Pointers to Pointers in C/C++
9:21
mycodeschool
Рет қаралды 544 М.
Pointers as function arguments - call by reference
14:16
mycodeschool
Рет қаралды 490 М.
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
Void Pointers | C Programming Tutorial
12:44
Portfolio Courses
Рет қаралды 11 М.
you will never ask about pointers again after watching this video
8:03
Pointers and dynamic memory - stack vs heap
17:26
mycodeschool
Рет қаралды 1,5 МЛН
Pointers and 2-D arrays
12:19
mycodeschool
Рет қаралды 487 М.
Function Pointers in C / C++
11:57
mycodeschool
Рет қаралды 440 М.
C++ Pointers to Pointers - Finally Understand Double Pointers
13:18
Dynamic memory allocation in C - malloc calloc realloc free
17:35
mycodeschool
Рет қаралды 892 М.
Introduction to linked list
17:13
mycodeschool
Рет қаралды 1,6 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН