diff options
Diffstat (limited to 'test/test19.cpp')
-rw-r--r-- | test/test19.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/test19.cpp b/test/test19.cpp new file mode 100644 index 0000000..56e7a6e --- /dev/null +++ b/test/test19.cpp @@ -0,0 +1,33 @@ +struct Data1 +{ + int val; +}; + +int k; + +int func1(struct Data1 *ptr1, struct Data1 *ptr2) +{ + Data1 *ptr3 = ptr1; +} + +int func2(struct Data1 *ptr1, struct Data1 *ptr2) +{ + Data1 *ptr3 = ptr1; + ptr3->val = 100; +} + +int func3(struct Data1 *ptr1, struct Data1 *ptr2) +{ + Data1 *ptr3 = ptr1; + if (ptr3) + ptr3->val = 100; +} + +int func4(struct Data1 *ptr1, struct Data1 *ptr2) +{ + Data1 *ptr3 = ptr1; + if (ptr3) + ptr3->val = 100; + else if (!ptr1 && ptr2) + ptr2->val = 200; +} |