1.通俗的来说,泛型指针声明为void *,但是有什么用呢?看标准库中memcpy函数用法:
#include <stdlib.h>
#include <string.h>
struct point
{
double x;
double y;
};
typedef struct point Point;
Point p1(1.1, 2.2);
Point p2(0.0, 0.0);
memcpy(p2, p1, sizeof(Point));
int x = 1;
int y = 0;
memcpy(y , x, sizeof(int));
我们已知