diff --git a/main.c b/main.c index 3d64d12..d0e237e 100644 --- a/main.c +++ b/main.c @@ -17,13 +17,17 @@ void Post_init(Post *self) { *self->body = '\0'; } +void Post_printf(Post *self) { + printf("%s\n\n%s\n", self->author, self->body); +} + void Post_dealloc(Post *self) { free(self); } int main(void) { Post *post = Post_alloc(); - printf("%s\n\n%s\n", post->author, post->body); + Post_printf(post); Post_dealloc(post); return 0; }