No video

Pointer Notation | C Programming Tutorial

  Рет қаралды 7,726

Portfolio Courses

Portfolio Courses

3 жыл бұрын

An overview of using pointer notation in C. Source code: github.com/portfoliocourses/c.... Check out www.portfoliocourses.com to build a portfolio that will impress employers!

Пікірлер: 31
@yassinedarbal-8683
@yassinedarbal-8683 4 ай бұрын
Thank you so much really, the concept of pointers and arrays was a bit blurry for me, I used to find it very tedious to fathom. Thanks to your videos I can now go ahead and use pointers easily Your channel is really a treasure for anyone interested in C
@nkonyanechristopher
@nkonyanechristopher 2 жыл бұрын
that's lesson 101 in embedded mcu programming, thanks for these videos
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
You’re welcome Christopher! :-)
@chillydill4703
@chillydill4703 6 ай бұрын
I remember the first time I saw pointers, it was just mumble jumble and very abstract and hard concept to grasp. Nowadays, it's my bread and butter. This video should have been available when I started! The topic is so simple once you learned it.
@PortfolioCourses
@PortfolioCourses 6 ай бұрын
It’s true pointers can be so tricky to learn especially as a beginner but once you do learn them they’re not so bad. :-)
@D_Ladybug
@D_Ladybug 2 жыл бұрын
Thank you for these videos.
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
You’re welcome Olamide! :-)
@sandeepvk
@sandeepvk 5 ай бұрын
I am still struggling to get my head around pointers. Especially the dereferencing part. For eg I declare a pointer Why do i have use * for both referencing and dereferencing a pointer ! and the &
@yigitcoban9823
@yigitcoban9823 Жыл бұрын
It has been awesome.
@PortfolioCourses
@PortfolioCourses Жыл бұрын
Excellent I'm glad to hear that! :-)
@ryanalnaser914
@ryanalnaser914 2 жыл бұрын
whatever anything I do before or after or anything
@ryanalnaser914
@ryanalnaser914 2 жыл бұрын
whatever before or after or anything I do or did or know or knew or anything
@ColeHartman1
@ColeHartman1 Жыл бұрын
This comment is more confusing then pointers
@zizou5638
@zizou5638 Жыл бұрын
what if I wanted to print the first value "1" using pointer notation after b++? can *(b-1) get me the value of "1" and in array notation after passing (a+1) to the function, how to get the first value of "1"?can a[-1] get me the value of "1" THANKS A LOT FOR THE VIDEOS :)
@PortfolioCourses
@PortfolioCourses Жыл бұрын
You're welcome! Great question, and yes, both of those should work fine. :-) This answer here speaks a bit about this: stackoverflow.com/a/3473686.
@zizou5638
@zizou5638 Жыл бұрын
@@PortfolioCourses thank you 🙏
@PortfolioCourses
@PortfolioCourses Жыл бұрын
@@zizou5638 You're welcome! 🙂
@Monica-cq2hr
@Monica-cq2hr Жыл бұрын
If it is a single dimension we can do like this....can u help me for two dimension sir by giving hint
@PortfolioCourses
@PortfolioCourses Жыл бұрын
I have this video on dynamically allocating a 2D array that you might be helpful Monica? :-) kzfaq.info/get/bejne/kLKTkrKh37SoYpc.html
@AxelWerner
@AxelWerner Жыл бұрын
In your example a mem address is a 8 byte long address. So an array is simply a pointer pointing to a place that contains such an address in the consequent 8 bytes. But there is somehow a type involved. A p++ results in an address+size of type, right? But where in mem is this information about of what types a pointer is?
@PortfolioCourses
@PortfolioCourses Жыл бұрын
It’s the compiler that maintains how large the value pointed to be the pointer is, and so it’s not really “stored in memory” so much as “in the code the compiler creates”. :-)
@AxelWerner
@AxelWerner Жыл бұрын
@@PortfolioCourses at runtime there is no compiler. yet still "somehow" the cpu knows how many bytes to "skip" when a pointer is updated to point to "the next element" in an array. That information/offset how far to jump/how far to skip must be written somewhere. i wonder how an array of say "ints" (4byte each) is organized in memory physically. somewhere there must be the information stored of WHAT TYPE the array is so the cpu knows how many bytes to skip to reach the "next element".
@PortfolioCourses
@PortfolioCourses Жыл бұрын
When we compile a C program that information about how any bytes to skip is put into the assembly (machine code) instructions that the CPU executes. The compiler makes those assembly instructions and it puts the information there, that’s how the CPU gets it.
@johnbode5528
@johnbode5528 5 ай бұрын
Nit: arrays are not pointers. Array _expressions_ are converted to pointers under most circumstances (for reasons that are too complicated to get into in a youtube comment). When you pass an array expression as a function argument, what the function actually receives is a pointer. As far as pointer arithmetic goes, the compiler simply generates code to add the right number of bytes to an address to yield the address of the next object; no metadata about types or sizes is actually stored in the executable (except maybe in a debug build).
@ryanalnaser914
@ryanalnaser914 2 жыл бұрын
whatever anything I do or did or know or knew or did not know I did not finish the video I will finish it inshallah
@fifaham
@fifaham Жыл бұрын
Thank you Kevin, very good tutorial. I made nice use of pointer arithmatic in one of my projects after watching many of your videos and learned a lot from you. I used pointer arithmatic to create a wireless packet for one of my projects and expanded on it. Decimal values (for wireless commands and data) are converted into packets for wireless communications (Bluetooth and WiFi) and worked nice. Data packets are created at the transmitter and are easily managed at the receiver side. I made a video about it for hardware designers who do software, like myself. kzfaq.info/get/bejne/j82Zrb1n1dipdn0.html many thanks for your great videos.
@PortfolioCourses
@PortfolioCourses Жыл бұрын
You're welcome Firas, I enjoyed your video, the step-by-step explanation was very nice! :-)
@fifaham
@fifaham Жыл бұрын
@@PortfolioCourses Without your videos my video will not be on KZfaq. Many thanks Kevin.
@PortfolioCourses
@PortfolioCourses Жыл бұрын
You're very welcome Firas! :-)
Main Function Return Value | C Programming Tutorial
3:49
Portfolio Courses
Рет қаралды 10 М.
array vs &array Pointers Difference Explained | C Programming Tutorial
17:38
No empty
00:35
Mamasoboliha
Рет қаралды 10 МЛН
路飞太过分了,自己游泳。#海贼王#路飞
00:28
路飞与唐舞桐
Рет қаралды 37 МЛН
Clown takes blame for missing candy 🍬🤣 #shorts
00:49
Yoeslan
Рет қаралды 47 МЛН
Dynamic Memory Allocation | C Programming Tutorial
31:51
Portfolio Courses
Рет қаралды 80 М.
Master Pointers in C:  10X Your C Coding!
14:12
Dave's Garage
Рет қаралды 293 М.
Pass By Reference | C Programming Tutorial
10:12
Portfolio Courses
Рет қаралды 34 М.
File Access Basics | C Programming Tutorial
24:05
Portfolio Courses
Рет қаралды 89 М.
What are double pointers in C?
14:43
CodeVault
Рет қаралды 42 М.
Function Pointers | C Programming Tutorial
18:31
Portfolio Courses
Рет қаралды 58 М.
you will never ask about pointers again after watching this video
8:03
Low Level Learning
Рет қаралды 2,1 МЛН
Advanced C: The UB and optimizations that trick good programmers.
1:12:34
Eskil Steenberg
Рет қаралды 163 М.
2D Array Basics | C Programming Tutorial
14:10
Portfolio Courses
Рет қаралды 25 М.
No empty
00:35
Mamasoboliha
Рет қаралды 10 МЛН