Using Pointers to Print 2D Arrays

  Рет қаралды 192,047

Neso Academy

Neso Academy

Күн бұрын

Пікірлер: 76
@imMortAlDA2
@imMortAlDA2 4 жыл бұрын
Literally u cleared all my confusion within 4 minutes. Clear explanation 👌
@fidalgoverde
@fidalgoverde 4 жыл бұрын
That's why C is the most beautiful language of all.
@musaibmuneer1907
@musaibmuneer1907 3 жыл бұрын
I second that
@tayyab.sheikh
@tayyab.sheikh Жыл бұрын
Only when you have beautiful teachers to explain you. ❤ from 🇵🇰
@HopeNHopes
@HopeNHopes 2 ай бұрын
I won't be that sure :))))
@utkarshmalviya9458
@utkarshmalviya9458 5 жыл бұрын
Happy Teacher's Day Sir, Thank you for being such a great teacher.
@bimalmurali2781
@bimalmurali2781 4 жыл бұрын
you are great sir!! very good explanation..
@lokeshnegi5051
@lokeshnegi5051 4 жыл бұрын
really good voice quality
@mostafalabib8609
@mostafalabib8609 2 жыл бұрын
you have cleared my all confusions in just four minits, which I couldn't in 4 hours.
@soumi6720
@soumi6720 2 жыл бұрын
I WANT TO THANK THIS CHANNEL AND TEACHERS SO MUCH ESPECIALLY YOU SIR!
@prathaptalari3583
@prathaptalari3583 3 жыл бұрын
Superb explanation sir❤️❤️❤️❤️
@080_cse_sanjaykarthicks4
@080_cse_sanjaykarthicks4 3 жыл бұрын
I love this and because of new concepts like this, I am starting to love C as same as I love Python, which is the easiest programming language.
@tayyab.sheikh
@tayyab.sheikh Жыл бұрын
It's easy just because of his amazing teaching method.
@iqdotcode706
@iqdotcode706 4 жыл бұрын
Wow C is really great
@tomaszstanislawski457
@tomaszstanislawski457 Жыл бұрын
The address `&a[0][0]` points to a first element of the first row of the array. The row's type is `int[2]`. Therefore according C standard this program is undefined for anything because pointer arithmeticsis only allowed within a single array. `&a[0][0]+2` is fine for comparison while `&a[0][0]+3]` will invoke Undefined Behavior.
@Kim-rh9gt
@Kim-rh9gt 3 жыл бұрын
thank you bro , I've learned a lot from this channel
@qandos-nour
@qandos-nour 4 жыл бұрын
Great but maybe is not useful when we want to print array in row column format it will print it in one row
@dubstepbanane6277
@dubstepbanane6277 7 ай бұрын
You can add a and check when to print that
@HopeNHopes
@HopeNHopes 2 ай бұрын
Love from Iran🇮🇷❤
@mustafatarig5412
@mustafatarig5412 Ай бұрын
0:33 *n rows , not n-1 rows
@livenow1656
@livenow1656 Жыл бұрын
Superbbb🔥🔥
@NivaethanRudraharan
@NivaethanRudraharan 5 ай бұрын
Great and helpful
@sudhanshukaul1350
@sudhanshukaul1350 Жыл бұрын
Respect+++ for this guy
@skdkdmdmsjdjdj2377
@skdkdmdmsjdjdj2377 Жыл бұрын
Finally we found a purpose for pointers
@carlossantamaria1820
@carlossantamaria1820 3 жыл бұрын
so in 2d arrays when we pass the 2d array as argument to a function, we pass the base address as well right?
@sukhbeersingh5811
@sukhbeersingh5811 3 жыл бұрын
Yes
@musicalvibes9541
@musicalvibes9541 2 жыл бұрын
Very good explaination
@trueresources3847
@trueresources3847 3 жыл бұрын
how are 2D arrays stored in c++??? row major or column major??
@greenxdshadow6635
@greenxdshadow6635 2 жыл бұрын
row major, he said it in the video
@soumiksaha1595
@soumiksaha1595 5 жыл бұрын
Thanks Sir, So much helpful!!!
@patricioemilianomoralesdia7578
@patricioemilianomoralesdia7578 2 жыл бұрын
I totally agree
@AbhishekV-t8f
@AbhishekV-t8f 6 ай бұрын
Can someone please tell me what the time complexity is for the pointer based approach? Is it O(n) or O(n^2) Thank you
@jeethendra374
@jeethendra374 5 ай бұрын
its o(n)
@serendipityx737
@serendipityx737 2 жыл бұрын
you saved my life
@venkateshpolisetty5624
@venkateshpolisetty5624 4 жыл бұрын
Sir, you told the array name itself holds the base address of the first element of the array. Then what is the need of '&' in front of a[0][0] in the for loop?
@krishnachaitanyareddygujju2823
@krishnachaitanyareddygujju2823 4 жыл бұрын
array name holds the base address, therefore we use " a " not "a[0][0]"; a[0][0] is a value not address; &a[0][0] is address in for loop you can use this, "for(p = *a ; p < *(a+row); p++)" or "for(p=&a[0][0];p
@krishnachaitanyareddygujju2823
@krishnachaitanyareddygujju2823 4 жыл бұрын
@@nivasreddy yes, in this case we can do it in two ways 1)int a[2][2]; 2)int a[ ][2]; Both will do just fine
@aProudHinduatani
@aProudHinduatani 4 жыл бұрын
Just awesome 👌👌👌
@pallavi_10
@pallavi_10 3 жыл бұрын
Well explained sir thank you so much🤗
@shrutikabagul2886
@shrutikabagul2886 4 жыл бұрын
Very helpful video Thank you so much
@marbles5590
@marbles5590 2 жыл бұрын
I made some code similar to yours because the first one (merely following the code shown in the video) showed an error after compiling. So this is the modified one: #include int main() { int rows, cols; printf ("Enter row: "); scanf ("%d", &rows); printf ("Enter column: "); scanf ("%d", &cols); int arr[rows][cols]; printf ("Enter %d numbers: ", rows*cols); int i, j; for (i=0; i
@m.anharmunir615
@m.anharmunir615 Жыл бұрын
thanks bro!
@taibohere
@taibohere Жыл бұрын
I have anomaly? When we have *p pointer then it's value will be printed And when we have simple p the address will be printed am I right??
@sanctuary_of_soul
@sanctuary_of_soul 2 жыл бұрын
You have pretty nice accent, thanks for that. And of course THANKS for the video: it is very useful.
@nilanjankar4522
@nilanjankar4522 4 жыл бұрын
In this case, we can't change the line after printing a row. Am I right?
@georger844
@georger844 4 жыл бұрын
You can use an if statement i guess
@carlossantamaria1820
@carlossantamaria1820 3 жыл бұрын
@@georger844 how?
@MKSundaram
@MKSundaram 4 жыл бұрын
Can I access the array index number instead of value using a pointer? If yes, how?
@pranaylambat9743
@pranaylambat9743 5 жыл бұрын
Is This playlist includes data structures or not? ...
@albinsanthosh8697
@albinsanthosh8697 3 жыл бұрын
tahks bro
@pranaylambat9743
@pranaylambat9743 5 жыл бұрын
Data structures???
@nikolaiunger6932
@nikolaiunger6932 5 жыл бұрын
best teacher ever
@akshayrathod1591
@akshayrathod1591 5 жыл бұрын
Sir how should i get the remaining video playlist of data structure? please tell me procedure.
@shabeerkhan379
@shabeerkhan379 5 жыл бұрын
Great@
@cezzar5233
@cezzar5233 2 жыл бұрын
Int p , h; P = &h; P in this case is a pointer, am i right? I mean it is not a normal variable anymore?
@handle_gc
@handle_gc Жыл бұрын
p is int variable P is not defined If you wanna declare P as pointer use * while declaring int *P=&h; or int *P; P=&h;
@jagdeepsingh-tv4ty
@jagdeepsingh-tv4ty 5 жыл бұрын
anyone please ! int *ptr; for(ptr=&a[0][0][0] ; ptr
@goumuk
@goumuk 5 жыл бұрын
You can understand this using one dimensional array itself. if array length is 5 for example, you will write for loop condition as for(ptr=&arr[0]; ptr
@nj10018
@nj10018 4 жыл бұрын
Answer= **(*(a+1)+1)
@bytecodeskool
@bytecodeskool 5 жыл бұрын
Sir please upload more and more videos and please complete the playlist I have exam please sir
@Yuvapriya-zx1jg
@Yuvapriya-zx1jg Жыл бұрын
Sir it doesn't print all values 1,2,3,4 it prints only 3 and 4
@lateefwani2676
@lateefwani2676 5 жыл бұрын
Sir if i join neso academy... Can I get videos other than uploaded by you...?????????????
@sumitgothankar6021
@sumitgothankar6021 5 жыл бұрын
c++ tutorials please
@esbatu13
@esbatu13 Жыл бұрын
That can't run on c++ why ?
@esbatu13
@esbatu13 Жыл бұрын
#include using namespace std; int main() { int A [3][3]; cout *i ; } for (int a = 0; a
@abhiavinash5164
@abhiavinash5164 4 жыл бұрын
I'm getting error while I.m initilizing p=a in for loop instead of p=&a[0][0]... sir u said, arr name can be use as pointer and it points to 1st elements, then y its not working for 2D
@ritikshrivastava9442
@ritikshrivastava9442 4 жыл бұрын
Same doubt brother
@iamgroot20
@iamgroot20 4 жыл бұрын
Can someone write program for it
@shinimasud8931
@shinimasud8931 11 ай бұрын
Many of us have fallen during our journey ☠.
@bytecodeskool
@bytecodeskool 5 жыл бұрын
Within 25 june try to complete all the series
@paulosergiorodriguesdasilv7711
@paulosergiorodriguesdasilv7711 3 жыл бұрын
LENGENDS!?
@saurabhbaij
@saurabhbaij Жыл бұрын
done
@mysterious5729
@mysterious5729 11 ай бұрын
Ye tho bawal chizz h be.. system hil jaye 😂
@karnatakamsangeeta5338
@karnatakamsangeeta5338 5 жыл бұрын
1,2,1,3,2,5,3,7, this series is a mixture of two series all the the odd terms in this series form a fibonacci series and all the the even erms form the prime numbers in ascending order.write a program o find nth term in the series. I want easy explanation n coding of this question sir
@1012ube
@1012ube 4 жыл бұрын
did you just say even prime numbers?
Dynamically Allocate A 2D Array | C Programming Tutorial
15:58
Portfolio Courses
Рет қаралды 42 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
why do void* pointers even exist?
8:17
Low Level
Рет қаралды 399 М.
Introduction to Two-Dimensional (2D) Arrays
10:20
Neso Academy
Рет қаралды 726 М.
Pointer Pointing to an Entire Array
5:22
Neso Academy
Рет қаралды 219 М.
Master Pointers in C:  10X Your C Coding!
14:12
Dave's Garage
Рет қаралды 338 М.
4. Dynamic 2d array C++
11:16
CSExplained
Рет қаралды 14 М.
you will never ask about pointers again after watching this video
8:03
Pointers and multidimensional arrays
16:45
mycodeschool
Рет қаралды 246 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН