C pointers explained👉

Published: 06 October 2021
on channel: Bro Code
172,749
8k

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;
}


Watch video C pointers explained👉 online without registration, duration hours minute second in high quality. This video was added by user Bro Code 06 October 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 172,74 once and liked it 8 thousand people.