comparison run/struct_08.d @ 0:3269e4627918

init dstress
author svnowner
date Sat, 25 Sep 2004 22:33:30 +0000
parents
children 3414705c41ac
comparison
equal deleted inserted replaced
-1:000000000000 0:3269e4627918
1 // $Header: /home/th/Dokumente/Entwicklung/MEIN_CVS/MiniD/src/run/struct_08.d,v 1.1 2004/08/20 23:42:54 th Exp $
2
3 struct MyStruct{
4 int data() {
5 return m_data;
6 }
7
8 void data(int value) {
9 m_data = value;
10 }
11
12 private:
13 int m_data;
14 }
15
16 int main(){
17 MyStruct m;
18
19 m.data = 3;
20 assert ( m.data == 3);
21
22 m.data(5);
23 assert ( m.data() == 5);
24
25 return 0;
26 }