C Programming Tutorial 96 - Passing by Value vs Pointer

preview_player
Показать описание


~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~

🅑 Bitcoin - 3HnF1SWTzo1dCU7RwFLhgk7SYiVfV37Pbq
🅔 Eth - 0x350139af84b60d075a3a0379716040b63f6D3853
Рекомендации по теме
Комментарии
Автор

I'm growing more powerful with each video.

darnell
Автор

Omg this explanation is what I needed :))) 3rd year of my electrical engineering degree and I never fully understood how they worked till now!! Thanks man, u need more recognition your content in superb 👌 keep up the good work :)

jenkoguzkaya
Автор

Excellent explanation of this ‘kind of difficult to grab’ concept. The comparison of the function returning an int and the function returning void drives the point home! Bravo.

philippe
Автор

Long story short:

int doubleValue(int x)
x = x * 2
return x;
^ this function creates a variable that only it can access, and makes it own value with the other passed variable's value.

void doubleValue(int *x)
*x = *x * 2
^ this function takes the variable passed in the argument, and changes it's value directly.

TheyungTravler
Автор

this is amazing, I wondered what pointers are useful for and this was just the information I needed!

deralex
Автор

As confusing as it sounds this actually made sense to me ha

HamedAdefuwa
Автор

I read that call-by-reference is not possible in C, only in C++ ....like "doublevalue(&x)". If I try this it doesnt work.
Only "doublevalue(x)", call-by-pointer.

oliveryt
Автор

It is confusing, but I get it right when I imagine it as :
Name of variable is for compiler a id of that value; then is blank box where is hold adres in memory; then there is next box holding data. Interesting is that pointer for compiler is also a data type. That means creating pointer, You just creating data type of memory adres.
And returns int or another data in original "destination".
Pointer for compiler in visual representation should look like this... Int a[0x65hg2][0x650d]
Pointer like You see have his one area which can be used for another pointer, and holds data representing adres of destination. And compiler knows that he need jump to that area to pick up value on that place. And return int which for compiler means how much bytes there are for read.

maximo
Автор

I understand what pointers are it's enough for me xD Started with coding. Thanks !

eyyubaydin
Автор

You're a fantastic teacher, thank you!

FreeMayaTutorials
Автор

Doesn't the integer variable 'y' need to be declared as a pointer as well or no? Thank you! First year of SE and you've been incredibly helpful!

Damdahlf
Автор

...scanf needs amoersand, but for arrays...

jadoaesra
Автор

why does my dad make me watch this stuff?

FMEdits
Автор

Hey man!! That's not professional, to put music before even the last 30 seconds of explanation start!?!? Please try to avoid that, this is academic stuff, no EDM-ending required, in addition, people may stop watching your videos because of that... I won't, but pleases, fix that.

JoanRuizz