How to return and pass a struct to a function

preview_player
Показать описание
The difference between C and other languages is quite obscure even if the syntax is the same.
Рекомендации по теме
Комментарии
Автор

What a fantastic lecturer! Always straight to the point (and to the subtlest and most important ones!). Your explanations are always cleanly compiled.

ramelgov
Автор

Finally understand why so many library functions ask for a pointer for result instead of using a return value.

drcl
Автор

This is a really worthwhile and best video on returning the structs!

yabool
Автор

I really hope you get more subscribers man, your video are by far the best when it comes to c programming.

giuliomoscatoba
Автор

I'm from the 80's and your video is really awesome how you expose through levels the right use of pointers in a "healthly" way. Thanks for sharing!!.

juanmamani
Автор

That was simple amazing. Step by step, explaining the thought process at each one of them, until reaching the perfect code... Thanks!!

incognito
Автор

Excellent and on point explanation. Thank you.

GIGEO
Автор

Mastering C feels like learning some sort of arcane magic...

ChildishBerbino
Автор

Thanks bro.... you just cleared my confusion about C++ and C# about the default function calling type

sanjoy
Автор

Thank you so much for this, you are truly great!

Sarahhh
Автор

This was such a great video, I really learned a lot. Thank you so much!

OZtheVillain
Автор

You are such a good instructor! Thanks!

יונתןאלוני-רפ
Автор

Fantastic videos. Your instruction is very good.

dabunnisher
Автор

bcuz of your videos i am starting to understand and like C. Thank you.

vaibhavnayak
Автор

the fact that he doesnt look at notes or script shows me how well he knows his stuff in contrast to others

mjwgozb
Автор

thank you man
Keep up the good work!!

figiegi
Автор

Great video mate! Rewards from Argentina.

joacoalison
Автор

Hi, Nice vídeo, Very easy to understand, thank you.

fabiovsroque
Автор

Very well explained, better than I tend to do 😅 In my old job we had interns that I always had to teach to stop returning a value like it is done in Pascal or Java.
And I was very confused to find out that in college they didn’t learn that arguments go on the stack. That a stack pointer just moved back up when you exit and indeed if you had another thread running the stack could’ve been changed. We had that happen.
And ironically those Java, Python and pascal people hate seeing a pointer being passed to home a result. That’s a foreign concept to them. And that’s why I am a firm proponent of at least having students code in assembly for the first semester. Even on a simple 8 bit micro doesn’t need to be very complex.
Just to really understand how memory is used.

CallousCoder
Автор

How come we are able at 6:37, this works? We are trying to access a variable that got popped from the stack, for example if the function returned int*, and we tried to access that array that got allocated in the stack, we would even get a warning because we are trying to return the address of a local variable.

nash
join shbcf.ru