docs: add installation prerequisites and quickstart guide to README
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
class Point {
|
||||
int x = 0
|
||||
int y = 0
|
||||
|
||||
void print(this) {
|
||||
printf("Point(%d, %d)\n", this.x, this.y)
|
||||
}
|
||||
|
||||
int getX(this) {
|
||||
return this.x
|
||||
}
|
||||
|
||||
int getY(this) {
|
||||
return this.y
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
printf("=== Simple OOP Test ===\n\n")
|
||||
|
||||
printf("Test 1: Create object\n")
|
||||
Point * p = new Point()
|
||||
printf("Created point\n")
|
||||
|
||||
printf("Test 2: Access fields\n")
|
||||
printf("p.x = %d\n", p.x)
|
||||
printf("p.y = %d\n", p.y)
|
||||
|
||||
printf("Test 3: Call method\n")
|
||||
p.print()
|
||||
|
||||
printf("Test 4: Call getter methods\n")
|
||||
int px = p.getX()
|
||||
int py = p.getY()
|
||||
printf("Got x=%d, y=%d\n", px, py)
|
||||
|
||||
printf("\n=== Test Complete ===\n")
|
||||
return 0
|
||||
}
|
||||
Reference in New Issue
Block a user