?????????????????????????????????????????????б?????????????嶨?壺

#ifndef __POINT_H
#define __POINT_H
typedef struct _Point Point;
struct _Point {
      int x;
      int y;
};
#endif
#include "point.h"
Point *n = (Point *) calloc(1?? sizeof(Point));
n->x = 1;
n->y = 2;
....

????????????????????????????????????????????????????棬???????????в???????????????????????????塣????????????????????????????????????????????????????Щ?????????????????????????????嶨?塣

????????????????н????????????????????????????????????????????????????????????????????????Java/C++???????????????????

????1?????????????????????

????typedef struct Point *Point??

?????????????????п???????塣

????2????????????????????з????????????????з??????????????б??????????????ζ?????????????????????????÷??????????ɡ?

??????????????

????????point.h??

#ifndef __POINT_H
#define __POINT_H

typedef struct _Point *Point;

Point make_point();
void print_point(Point point);
void destroy_point(Point p);
#endif

?????????????point.c

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "point.h"

struct _Point {
    int x;
    int y;
};

Point make_point() {
    Point point = (Point) calloc(1?? sizeof(struct _Point));
    point->x = 0;
    point->y = 0;
    return point;
}

void print_point(Point point) {
    printf("point %d?? %d "?? point->x?? point->y);
}

void destroy_point(Point p) {
    if (p == NULL) {
         printf("warning?? destroying NULL object");
         return;
    }
    free(p);
}