⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 point.c

📁 Object-Oriented Programming With ANSI-C这本书中的源代码!找了很久
💻 C
字号:
#include <stdio.h>#include "Point.h"#include "Point.r"#include "new.h"#include "new.r"static void * Point_ctor (void * _self, va_list * app){	struct Point * self = _self;	self -> x = va_arg(* app, int);	self -> y = va_arg(* app, int);	return self;}static void Point_draw (const void * _self){	const struct Point * self = _self;	printf("\".\" at %d,%d\n", self -> x, self -> y);}static const struct Class _Point = {	sizeof(struct Point), Point_ctor, 0, Point_draw};const void * Point = & _Point;void move (void * _self, int dx, int dy){	struct Point * self = _self;	self -> x += dx, self -> y += dy;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -