#include<stdio.h> #include<stdlib.h>
typedef void* EHHandle;
EHHandle EdgeHandleInit(void) { #define Max ?10 ?? ?static int temp[Max][2] = { 0 }; ?? ?static int i = 0; ?? ?if(i< Max) ?? ??? ?return (int*)temp[i++]; ?? ?return (int*)-1; }
void SetValue(EHHandle s, int a, int b) { ?? ?int* temp; ?? ?temp = s; ?? ?temp[0] = a; ?? ?temp[1] = b; } void PrintValue(EHHandle s) { ?? ?int* temp; ?? ?temp = s; ?? ?printf("%d\t%d\n", temp[0], temp[1]); }
void main(void) { ?? ?int *i;
?? ?i = EdgeHandleInit(); ?? ?SetValue(i, 22, 33); ?? ?PrintValue(i); }
|