добавлен исходный код и ссылки

This commit is contained in:
Alexander Zhirov 2023-01-22 15:43:59 +03:00
parent c83ed6cf42
commit 4be7b9c4ce
15 changed files with 438 additions and 1 deletions

View file

@ -0,0 +1,25 @@
import std.stdio;
struct MyStruct
{
int data;
}
class MyClass
{
int data;
}
void main()
{
// Иг­ра­ем с объ­ек­том ти­па MyStruct
MyStruct s1;
MyStruct s2 = s1;
++s2.data;
writeln(s1.data); // Пе­ча­та­ет 0
// Иг­ра­ем с объ­ек­том ти­па MyClass
MyClass c1 = new MyClass;
MyClass c2 = c1;
++c2.data;
writeln(c1.data); // Пе­ча­та­ет 1
}