Swift Programming #11: Class and Struct

preview_player
Показать описание
In Swift, class and struct are similar, but also very different. To understand it in C++'s term, a variable of class is like a pointer to an object, a variable of struct is just the object itself.

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

Best Swift tutorials on YouTube live on your channel.

DatMafiaKitteh
Автор

Although your English is not native and not very easy to listen, but your approaches and communications way are excellent and extremely easy to catch up. Best description about Struct vs. Class on Youtube (vs. all stuffs I've ever tried). Keep going bro.

lynguyenkhuong
Автор

There's nothing surprising about the fact that you can change p5's properties, because p5 is a const pointer, and not a pointer to a const (or a const pointer to const).  This is exactly the same behavior as a const pointer in C++.  This is the problem with beginners learning on languages that try to pretend that pointers don't exist.  Stuff like this makes no sense unless one understands what is going on under the covers.

teknicalmusic
Автор

Nice video comparing structs and classes

matybrennan
join shbcf.ru