C pointers explained👉

preview_player
Показать описание
C pointers tutorial example explained

#C #pointers #tutorial

void printAge(int *pAge)
{
printf("You are %d years old\n", *pAge); //dereference
}

int main()
{
// pointer = a "variable-like" reference that holds a memory address to another variable, array, etc.
// some tasks are performed more easily with pointers
// * = indirection operator (value at address)

int age = 21;
int *pAge = &age;

printAge(pAge);

//printf("address of age: %p\n", &age);
//printf("value of pAge: %p\n", pAge);
//printf("size of age: %d bytes\n", sizeof(age));
//printf("size of pAge: %d bytes\n", sizeof(pAge));
//printf("value of age: %d\n", age);
//printf("value at stored address: %d\n", *pAge); //dereferencing

return 0;
}
Рекомендации по теме
Комментарии
Автор

Anytime I need to know something about programming, your channel is the first one I look for.

mindlessmeat
Автор

Just some advice.to truly understand this concept is a thorough way to apply it to your programs, I think it's best to take it slow. Don't feel bad, in my lecture I slowly and methodically took notes for hours on a 30 minute video to grasp the idea as a noob. It's ok to take your time, not all of us are coding gods. The only objective you should have is understanding it, and for each person that learns differently it's going to take varying time. As long as you come out with the knowledge, than your knowledge is just as effective as anybody elses.

HiiImChris
Автор

nice explanation, your tips on what's good practice makes it way easier to understand

katarinaclaes
Автор

As a CS major @ Virginia Tech, you have blessed me with a foundation that builds my confidence!

tybargky
Автор

Awesome sir keep it up. You have nice way of explanation

abhishekmaurya
Автор

this was the clearest way someone has ever explained pointers to me. thanks

spooders
Автор

Finally got a clear insight into what all these denotations in pointers mean. Thanks a ton, bro

preethi
Автор

great explanation, very clear, thank you!

juliannafotheringham
Автор

This is really clear, thank you! Got me though a mental block I was having on Codecademy

jamesharland
Автор

You cleared my mind about pointer with one view. Thanks a lot. I will be coming to check more videos from your channel. I’m learning c atm. Really appreciate man 🎉

ajitghising
Автор

Could you do a Scala series? That'd be so cool

accumulator
Автор

Great video. Can you make video about void pointers, array pointers, struct pointers as well?

provokator-provocateur
Автор

your vids are always easy to follow along. Thanks a lot

NNNedlog
Автор

#include <stdio.h>

void printAge(int *pAge)
{
printf("You are %d years old\n", *pAge); //dereference
}

int main()
{
// pointer = a "variable-like" reference that holds a memory address to another variable, array, etc.
// some tasks are performed more easily with pointers
// * = indirection operator (value at address)

int age = 21;
int *pAge = &age;

printAge(pAge);

//printf("address of age: %p\n", &age);
//printf("value of pAge: %p\n", &pAge);
//printf("size of age: %d bytes\n", sizeof(age));
//printf("size of pAge: %d bytes\n", sizeof(pAge));
//printf("value of age: %d\n", age);
//printf("value at stored address: %d\n", *pAge); //dereferencing

return 0;
}

BroCodez
Автор

It would be awesome if u teach or solve the problems of languages

seyhaseng
Автор

Hey bro thank you for your smooth well explained videos!❤

SleepyAizawa
Автор

I would really be glad if you'd make a video about double pointers. Many videos are on youtube but it hard to understand it. and when I watch your videos, I can understand it easily.
I am so thankful for all the tutotiral you made <3

stephensagarinojr.
Автор

bro, you deserve more than like, comment and subscribe. You are amazing mashaAllah

omarabbas
Автор

Wanted to watch your video in the background and got caught up. Thank you

FrancisAlexanderWood
Автор

had to watch this vid a couple times before i got it, very good explanation

literalspam