diff options
Diffstat (limited to 'test/test11.cpp')
-rw-r--r-- | test/test11.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/test11.cpp b/test/test11.cpp new file mode 100644 index 0000000..4debb95 --- /dev/null +++ b/test/test11.cpp @@ -0,0 +1,31 @@ +class Data1 +{ + public: + int val; +}; + +class Object1 +{ + int k; + + void func1(Data1 *ptr1, Data1 *ptr2) + { + if (!ptr1 || ptr1->val == 1) + { + return; + } + + ptr1->val = 100; + } + + void func2(Data1 *ptr1, Data1 *ptr2) + { + if (ptr1 && ptr1->val == 1) + { + ptr1->val = 100; + return; + } + + ptr1->val = 200; + } +}; |