Pointers (Important Questions)

  Рет қаралды 339,899

Neso Academy

Neso Academy

Күн бұрын

C Programming: Pointer's important problems.
Topic discussed:
1) Set of important questions based on the basics of pointers.
C Programming Lectures: goo.gl/7Eh2SS
Follow Neso Academy on Instagram: @nesoacademy(bit.ly/2XP63OE)
Follow me on Instagram: @jaspreetedu(bit.ly/2YX26E5)
Contribute: www.nesoacademy...
Memberships: bit.ly/2U7YSPI
Books: www.nesoacademy...
Website ► www.nesoacademy...
Forum ► forum.nesoacade...
Facebook ► goo.gl/Nt0PmB
Twitter ► / nesoacademy
Music:
Axol x Alex Skrindo - You [NCS Release]
#CProgrammingByNeso #CProgramming #Pointers #PointerQuestions #PointersInC

Пікірлер: 142
@sreelekshmi6044
@sreelekshmi6044 3 жыл бұрын
can't express my thanks through words.i am a beginner in the programming field and u r guiding me to a strong base. u r a gem sir.lots of love and respect for helping ordinary students like me.
@anrifckri8465
@anrifckri8465 2 ай бұрын
I actually never saw anyone able to explain pointers that well and I´ve been trying to understand pointers via KZbin for two days ! Ty man !
@kaushikipathak9258
@kaushikipathak9258 3 жыл бұрын
special thanks to the last question. It cleared my very basic doubt of pointer.
@harshitagarwal8022
@harshitagarwal8022 3 жыл бұрын
of course
@harshitagarwal8022
@harshitagarwal8022 3 жыл бұрын
you you also from CS Branch? I'm studying in IIIT Gwalior with CS.
@rahulsharma2572
@rahulsharma2572 3 жыл бұрын
@@harshitagarwal8022 what's do you think...if you tell here college name then she will be impressed by you... you are the true IITian😄😄😄
@deepakreddy1601
@deepakreddy1601 3 жыл бұрын
@@rahulsharma2572 IIITian bro 😂😂😂😂
@DeepakKumar-dw1re
@DeepakKumar-dw1re 3 жыл бұрын
😂🤣🤣Impress tou ho jaayegi...
@grimvian
@grimvian Жыл бұрын
Many beginners like myself, struggle with pointers, when the star symbol have different meanings. After a while I differentiate between making a pointers or the contents of pointers. It helps to have a good understanding hexadecimals and their relations to bytes and bits. And lastly use a debugger and single step through the code while monitoring the related memory.
@muhammadzohaib4454
@muhammadzohaib4454 3 жыл бұрын
THANKS A LOT!!! I am facing difficulties in the whole topic of pointers but now I have gained more refined concepts because of your such simple and great explanation. GOD BLESS YOU!
@richaranjan4334
@richaranjan4334 3 жыл бұрын
I loved the way you explain every topic.Now I realize ,I haven't learned well in 1st yr .I wish I could found your videos in 1st yr anyways now I follow ur channel n I got to learn new things.thanks to you.keep up doing this.
@rodm8113
@rodm8113 2 жыл бұрын
i just want to add this this is an incredibly helpful video. you have my infinite thanks for making this amazing series!
@dineshrajendran9593
@dineshrajendran9593 4 жыл бұрын
Tq for ur fantastic explanation sir. Before seeing this video I confused about pointers. But after your fantastic explanation I understood clearly especially with the last example of the video
@Mr.divyeshshukla
@Mr.divyeshshukla 2 жыл бұрын
Finally difference between pointers and indifference operators is get cleared in QNA session, thank you🙌
@krishnakishor7225
@krishnakishor7225 9 ай бұрын
In the first question you have explained that we cannot write int *p = &i; but in the third question where we are printing the address of pointer, you have used the same thung
@AaryamanBhattacharya
@AaryamanBhattacharya 3 жыл бұрын
I believe a small point needs to be raised for part (d) of question 4. You have made the assumption that the variable i is an integer, although this was never mention in the question. If the value stored in i was a hexadecimal value which could correspond to an address in memory wouldn't *i be a valid expression? And if this value corresponded to the address of i, then *i would evaluate to itself, therefore would be a valid alias. Therefore the answer to part (d) needs to be, if i does not hold a hexadecimal value of its own address, then it's not an alias for i. We need more information to confirm if it is an alias.
@nandanupadhyay4936
@nandanupadhyay4936 Жыл бұрын
but it is mentioned that i is a variable and p is a pointer. even if i stores a hexadecimal value it doesn't mean that it's an address. *i will point to a different value stored at position pointed by the value of i which won't be equal to i.
@travisbickle3841
@travisbickle3841 4 жыл бұрын
Thank you very much Neso Academy.I have learned a lot of important things that miss by my eyes.
@bmumut
@bmumut 6 ай бұрын
The most understandable video about basis of pointers I've ever seen. Thank you so much
@vidamate09
@vidamate09 4 жыл бұрын
Oh wow! A lot of things about the nature of pointers just made A LOT of sense with these questions!
@316key
@316key 3 жыл бұрын
Wow! This tutorial just so helpful for me to understand more about pointer. Thanks a lot!
@rakshitrk7893
@rakshitrk7893 4 жыл бұрын
Waited for that first question!!
@kolhatkarchinmay
@kolhatkarchinmay 5 жыл бұрын
Really Nice explaination...please come with more such C series
@abacas2175
@abacas2175 3 жыл бұрын
God gifted lectures🔥🔥
@mixtureshortsashish
@mixtureshortsashish Жыл бұрын
in question 3 you print the address of a pointer because you wrote 'p' in printf function. for print the address of a variable we write *p or 'i' in printf function insteed of p....... if i am wrong please comment down.....and i am right give a thumbsup👍
@aashishsingh9614
@aashishsingh9614 4 жыл бұрын
Best Chanel for c,pro💯💯💯✔️
@ericosmostech4903
@ericosmostech4903 4 жыл бұрын
Q2. but still constant is changeable! #include int fun(int *p){ //didn’t use const *p = 10; } int main(){ const int x= 8; fun(&x); printf("%d ",x); } //output 10
@trungngngng
@trungngngng 3 жыл бұрын
Type casting from const to non-const? Confusing C.
@techthatmatters141
@techthatmatters141 Жыл бұрын
the first question really solved one of my long time questions, context !!. Thanks boys
@jidaphanuttapanon3581
@jidaphanuttapanon3581 3 жыл бұрын
i am very confused about pointer,especially the first question.And you save my life!!! Thank you
@adammarley5616
@adammarley5616 Жыл бұрын
Came from CS50. Personally, I WAY prefer your explanation over theirs. Wonderful job. Thank you for the knowledge
@waliddkhili9948
@waliddkhili9948 2 жыл бұрын
I had the first question exactly. Thank you so much. These tutos are so satisfying.
@isroindia4771
@isroindia4771 4 жыл бұрын
You are God, what a level of explanation , and in depth.
@jpdoshi2811
@jpdoshi2811 2 жыл бұрын
Pointers is one of the difficult topics in programming, but after watching this vid, I got to use pointers, thanks
@alpicasoelcamo4388
@alpicasoelcamo4388 2 жыл бұрын
Your series of c programming is very helpful.Thanks for making such videos.
@andrewbrown2802
@andrewbrown2802 Жыл бұрын
Very helpful thank you
@zainabbohra2915
@zainabbohra2915 3 жыл бұрын
You are the best,actually excellent 😎
@user-qc7hz1xw5g
@user-qc7hz1xw5g 5 ай бұрын
Thank you sir❤
@aarchilohiya2408
@aarchilohiya2408 4 жыл бұрын
But sir in previous video you tell Int x=5,*ptr=&x
@ScholarStream_25
@ScholarStream_25 4 жыл бұрын
Man u deserve a million 💪!
@wastetanz
@wastetanz 3 жыл бұрын
This video was so helpful! thank you!
@2biorap308
@2biorap308 10 ай бұрын
You’re the best instructor on YT I’ve seen so far ❤
@pillaharmie8664
@pillaharmie8664 3 жыл бұрын
This is awesome ❣️💕💕
@VFXjiya
@VFXjiya 2 жыл бұрын
Nice questions about the pointer
@abijithpradeep7478
@abijithpradeep7478 3 жыл бұрын
Well explained...I loved it.....
@ehsannabil7893
@ehsannabil7893 8 күн бұрын
Thank you
@sriharsha3387
@sriharsha3387 2 жыл бұрын
Thanks is not at all enough for u sir it helped me a lot thanks sir
@anti-tankartur677
@anti-tankartur677 Жыл бұрын
wow thanks gave me a lot of clarity regarding pointers.
@alulaleak
@alulaleak 8 ай бұрын
This is a great video. Thank you. 🙏🏽
@terrathaw
@terrathaw 2 жыл бұрын
For question number 1, it'll be easier to answer if we had a habit of adding the * to the datatype rather than the variable names. For ex: int* p instead of int *p. Or int* fun() instead of int *fun(). Int *p just adds to more confusion for no real reason. The compiler is going to compile both expressions the same way. Writing it as int *p when the same thing when reading out loud is "pointer to int-p" is just plain stupid. One of the reasons why pointers is very confusing for beginners.
@ThomasEdits
@ThomasEdits Жыл бұрын
Very good point!
@muhammadnaveed7953
@muhammadnaveed7953 2 жыл бұрын
Absolutely awesome job Sir. Thank you... All cleared
@arghyakarmakar8422
@arghyakarmakar8422 2 жыл бұрын
Thanks for this great knowledgeable information
@_Who_u_are
@_Who_u_are 4 жыл бұрын
Thank you brother...Love from BD
@Nmind-Nbody
@Nmind-Nbody 2 жыл бұрын
Tq Bro,U helped a lot,Pls Try to make more questions on this concept
@denizturk4307
@denizturk4307 3 жыл бұрын
good educational content .
@venkateshshanigarapu6673
@venkateshshanigarapu6673 3 жыл бұрын
Please explain near pointer, far pointer and huge pointer in C language
@pratikzore7343
@pratikzore7343 5 жыл бұрын
very well stuff .....pls come with more C content & c++
@worldshello5907
@worldshello5907 3 жыл бұрын
Great teacher ^^!
@pavithrababu9404
@pavithrababu9404 5 жыл бұрын
Thank you so much.. 😍
@Loving_Earth
@Loving_Earth 3 жыл бұрын
Tq so much sir 🙏🏻🙏🏻🙏🏻
@virendrapilaniya4805
@virendrapilaniya4805 4 жыл бұрын
excellent explanation
@sergiucristiancorboveanu3446
@sergiucristiancorboveanu3446 3 жыл бұрын
Thanks
@bharathkumars8535
@bharathkumars8535 4 жыл бұрын
Simply Awesome ❤
@emreburakeyidogan
@emreburakeyidogan Жыл бұрын
unique teaching method !
@mustafakarakas1116
@mustafakarakas1116 4 жыл бұрын
when you use %p to see address of variable you wıll see the result whıch ıs hexadecımal,to see decımal you should %d as usual.
@alvinaug3844
@alvinaug3844 4 жыл бұрын
thankuuuu
@mustafakarakas1116
@mustafakarakas1116 4 жыл бұрын
@@alvinaug3844 np
@salilkale6654
@salilkale6654 Жыл бұрын
Awesome set of videos. from Neso..
@dishasaumymondal2675
@dishasaumymondal2675 5 жыл бұрын
Nice explanation
@lailymedha595
@lailymedha595 2 жыл бұрын
thank you very much! this is so brilliant.
@SDP45
@SDP45 9 ай бұрын
Thank you sir
@AmarKumar-vo2bv
@AmarKumar-vo2bv 5 жыл бұрын
Thank u very much
@mathumathusan154
@mathumathusan154 3 жыл бұрын
love you sir
@littlestarmalli7106
@littlestarmalli7106 5 жыл бұрын
In question 2: If we remove const to *p. Then it is generating o/p 0. But i variable is also const , then why it is getting o/p.
@thakkarmaurya4729
@thakkarmaurya4729 Жыл бұрын
assignment of read-only location '*p'
@vish3933
@vish3933 4 жыл бұрын
Awesome explanation 👍
@psyferinc.3573
@psyferinc.3573 5 ай бұрын
thasnk you
@codechamp4763
@codechamp4763 Жыл бұрын
int num = 69; printf("%d ",&num); int *ptr = # *ptr = # printf("%d",num); this definitely works, hence last 2 statements at 2:51 are wrong!!!!!
@choephel4565
@choephel4565 2 жыл бұрын
Wow. You rocks. 🤟🤟🤟🤟
@Anilyadav-rb8ft
@Anilyadav-rb8ft Жыл бұрын
in q3 int *p=&i is correct or not,because in first question we learn that *p is integer pointer variable which cant hold the address value
@user-nh8ei4fi3p
@user-nh8ei4fi3p 28 күн бұрын
It is correct... Because it indicates to the compiler that p is not a simple variable rather than it's a pointer which points to a integer type data... But after declaring a pointer, if we again put a * in front of it this will indicate to the value Stored in the particular address which is stored in the pointer, ie, it will indicate to the integer not to the address of it
@maheejaman1625
@maheejaman1625 2 жыл бұрын
There is a slight mistake or idk what that is! *&p and &*p always prints the address of I. According to normal logic , *&p should print the garbage inside p and &*p should print the address of p! Then why it always prints the address of the pointer "p"? I love your classes by the way sir ! 😁
@zizou5638
@zizou5638 2 жыл бұрын
I think it has something to do with precedence and I think & has the higher precedence maybe. Please correct me if I'm wrong.
@vaishnavi4354
@vaishnavi4354 4 жыл бұрын
What's the difference if we use the %u to print address rather than %p?
@sid8130
@sid8130 4 жыл бұрын
%u- unsigned integer type %p- unsigned hexa decimal type
@vaishnavi4354
@vaishnavi4354 4 жыл бұрын
@@sid8130 Thanks a lot,🙇🙇
@Hiyori___
@Hiyori___ 3 жыл бұрын
question 4 was amazing.
@saichaithrik7134
@saichaithrik7134 4 жыл бұрын
Thank you neso
@deveshmeena5481
@deveshmeena5481 3 жыл бұрын
thanks man
@andistheinforitbutso7513
@andistheinforitbutso7513 2 жыл бұрын
Evening Sir
@stevefox2318
@stevefox2318 3 жыл бұрын
Now pointers are cakewalk
@true4189
@true4189 3 жыл бұрын
Thank u
@MohamedAbdulRaouf
@MohamedAbdulRaouf 4 жыл бұрын
Keep going bro, you're a legend
@subharatnodas4737
@subharatnodas4737 4 жыл бұрын
What will happen if we write **&p? Is it allowed to write so?
@bishalrajbhattarai5482
@bishalrajbhattarai5482 4 жыл бұрын
Doesnot give sense
@VikramKumar-rj6pu
@VikramKumar-rj6pu 3 жыл бұрын
Yes you can write ,it gives value of i
@balanjaneyasharma4347
@balanjaneyasharma4347 4 жыл бұрын
Nice video
@adhishravi20
@adhishravi20 4 жыл бұрын
We would also have segmentation fault ?
@aryashahi2425
@aryashahi2425 3 жыл бұрын
Here the address is of which data type? It includes integer as well as character!
@invincible6230
@invincible6230 10 ай бұрын
Sir then what is the significance of the number that is coming in output? #include int main() { int i = 10; int *p = &i; printf("%d", p); return 0; }
@EricZepeda320
@EricZepeda320 3 жыл бұрын
🔥🔥🔥🔥
@codechamp4763
@codechamp4763 Жыл бұрын
41:21
@quantumnature6641
@quantumnature6641 4 жыл бұрын
But what will happen if i = 3000 And I want *i. ???Then will it give a value located a address 3000??
@8444
@8444 4 жыл бұрын
Creative Minds nope u cant directly do this because i is a not pointer but u can give a constant memory adress by your own by doing İnt *p; P= 3000; Now p points the memory adress 3000
@hammadhusainquraishi1185
@hammadhusainquraishi1185 3 ай бұрын
2:41
@abdullahrahad3584
@abdullahrahad3584 4 жыл бұрын
9:58
@AjithKumar-pb5zs
@AjithKumar-pb5zs 4 жыл бұрын
Bro one thing you told was wrong We can modify const int value either by pointer or scanf function.
@vishallondhe7298
@vishallondhe7298 4 жыл бұрын
www.onlinegdb.com/online_c_compiler he is correct man, stop misguiding people p.s. you can change it but you have to use non constant pointer to do this.
@Ray-ej3jb
@Ray-ej3jb 3 жыл бұрын
No the question also is why isn't the second statement declared
@mdfarhan5892
@mdfarhan5892 3 жыл бұрын
error: assignment of read-only location ‘*p’
@alroygama6166
@alroygama6166 5 жыл бұрын
Where is your data structur lectures???can't find it??
@ayushpant6190
@ayushpant6190 4 жыл бұрын
int i =10; int *p = &i; printf("%p", p) // Instead of this can't I directly do printf("%d", &p); ?
@adhishravi20
@adhishravi20 4 жыл бұрын
No, because it is considered to be illegal accessing the content of a pointer variable
@adhishravi20
@adhishravi20 4 жыл бұрын
Sorry , it will print the address
@neerajbaishya781
@neerajbaishya781 4 жыл бұрын
It shows some garbage value
@mdfarhan5892
@mdfarhan5892 3 жыл бұрын
i am getting too much error while writing same same code that you shown .
@elhosseninoureldeen6991
@elhosseninoureldeen6991 3 жыл бұрын
slides of this course is available ?
@MKSundaram
@MKSundaram 3 жыл бұрын
Why does the address of a variable keep changing?
@archipalexandru-ioan5898
@archipalexandru-ioan5898 3 жыл бұрын
its never the same value,its a random addres of memory everytime you compile it
@snehbhandari8352
@snehbhandari8352 4 жыл бұрын
I didnt get e part of ques 3 right
@codechamp4763
@codechamp4763 Жыл бұрын
hence last 2 statements at 2:51 are wrong!!!!!
Pointer Arithmetic (Addition)
7:10
Neso Academy
Рет қаралды 236 М.
Introduction to Pointers | C Programming Tutorial
24:42
Portfolio Courses
Рет қаралды 110 М.
C Programming (Important Questions Set 1)
13:42
Neso Academy
Рет қаралды 1,4 МЛН
Pointers complete tutorial | Pointers in C in Tamil | Logic First Tamil
1:00:08
Weak Pointers in C++ (std::weak_ptr)
17:25
The Cherno
Рет қаралды 48 М.
why do void* pointers even exist?
8:17
Low Level Learning
Рет қаралды 359 М.
C pointers explained👉
8:04
Bro Code
Рет қаралды 162 М.
you will never ask about pointers again after watching this video
8:03
Low Level Learning
Рет қаралды 2,2 МЛН
Master Pointers in C:  10X Your C Coding!
14:12
Dave's Garage
Рет қаралды 304 М.
Pointer Practice Problems & Examples
27:33
Jonathan Muckell
Рет қаралды 2,4 М.