C Programming Tutorial 80, Writing a Generic Swap Function

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

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

Very nice video, really helpful! Thanks and congrats!

Matei_Paunescu
Автор

Hi Adam
Thank you so much for your informative video.
I followed your tutorial and all of them are clear. You explain difficult subject in a simple way.

MultiMahdiyar
Автор

I'm not really sure at this point, but it does interest me so we'll see. I have a mental list of ideas for upcoming series and that's on there.

iTzAdamX
Автор

Yeah I'm going to continue on with the series.

iTzAdamX
Автор

Nice job man, :) - this was helpful; Now i don't have to write a million swap functions in c.
But C# is another

Thesurvivour-ylhd
Автор

this video rocks simple ease and to the point, thx

JohnHinkley
Автор

These videos are brilliant helped me out a lot with C programming. Is there any chance you'll be making PHP tutorials ?

daleoshea
Автор

apologizing for the language, but this made generic pointer so much fucking clearer for me :)

huamichaelchen
Автор

Nice video, but I don't believe that you need to use memcpy(). I think the C compiler will give you member-wise copy by just using an assignment operator.

fract1 = fract2;

I haven't tested it extensively, but I know that it works in the cases I've tried. Thanks for all the videos though--very helpful!

tcbetka
Автор

OK, I researched this a bit more... You might indeed have to use memcpy(), as you were passing pointers. Otherwise it appears that you'll just get a shallow copy. From the two links I found, memcpy seems to give a deep copy which is of course safer. I'll need to keep researching it, but is this your understanding as well?

tcbetka
Автор

Nope, because you need to know how many bytes to copy into the temporary memory, and there's no way of knowing without the size being passed in.

iTzAdamX
Автор

Hi, thanks a lot!
Is there any option to write swap function only with the void* params with out the size?
my friend was asked about it in a job inetrview

qazdaf
Автор

Maybe there just aren't that many people interested in C. I think a lot of people would rather learn a language like Java so that they can make games easily.

iTzAdamX
Автор

will have more videos of C? I am studying it in college and this helped me a lot. =]

BrunoTargaryen
Автор

Nope, I don't even know PHP. I think that there are a bunch on thenewboston's channel.

iTzAdamX
Автор

Well not to be rude but i dont care the games or JAVA, C is the way to go! Try making a OS in java or some complicated stuff in Java rather than games or web apps. Games might be good for learning but real stuff and curious stuff is in the core programming of all! Assembler & C unmatched pair!

thewhisperinyourears