1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-24 20:52:22 +00:00
2018-01-05 22:14:23 +08:00

15 lines
249 B
C++

#include "person.h"
#include <stdio.h>
extern "C" void Main() {
auto p = Person::New("gopher", 10);
char buf[64];
char* name = p->GetName(buf, sizeof(buf)-1);
int age = p->GetAge();
printf("%s, %d years old.\n", name, age);
p->Delete();
}