diff --git a/tests/20_pointer_comparison.c b/tests/20_pointer_comparison.c new file mode 100644 index 0000000..9561ac9 --- /dev/null +++ b/tests/20_pointer_comparison.c @@ -0,0 +1,16 @@ +int a; +int b; +int *d; +int *e; +d = &a; +e = &b; +a = 12; +b = 34; +printf("%d\n", *d); +printf("%d\n", *e); +printf("%d\n", d == e); +printf("%d\n", d != e); +d = e; +printf("%d\n", d == e); +printf("%d\n", d != e); + diff --git a/tests/20_pointer_comparison.expect b/tests/20_pointer_comparison.expect new file mode 100644 index 0000000..5d1e5f5 --- /dev/null +++ b/tests/20_pointer_comparison.expect @@ -0,0 +1,6 @@ +12 +34 +0 +1 +1 +0