+ 1

Value Types

Is it possible to have two variables refer to the same data structure (like an array), considering the fact that an array is a value type? If so, how would u do this?

4th May 2017, 5:24 AM
FishermanMan
3 Respuestas
+ 7
I didn't understand some words .But here is an example of structure .it may help .it doesn't have arry. https://code.sololearn.com/cqo3C4czvG0N/?ref=app
4th May 2017, 5:29 AM
Enas Emad
Enas Emad - avatar
+ 2
Thanks!
5th May 2017, 2:15 AM
FishermanMan
0
class A{ var a = 0 } let abc = A() print(abc.a) let bb = abc bb.a = 3 print(bb.a)
13th May 2017, 9:16 PM
Hamza Ahmed Khan
Hamza Ahmed Khan - avatar