summaryrefslogtreecommitdiff
path: root/tests/exec/constructor1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/exec/constructor1.cpp')
-rw-r--r--tests/exec/constructor1.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/exec/constructor1.cpp b/tests/exec/constructor1.cpp
new file mode 100644
index 0000000..b5ed3e7
--- /dev/null
+++ b/tests/exec/constructor1.cpp
@@ -0,0 +1,16 @@
+#include <iostream>
+
+class A {
+public:
+ int x;
+ int y;
+ A (int x, int y);
+};
+
+A::A(int x, int y) { this->x = x; this->y =y; }
+
+int main() {
+ A a = A(17, 42);
+ std::cout << a.x << "\n";
+ std::cout << a.y << "\n";
+}