标签:div mcr char int col value cal 有序 calloc
typedef struct { int cur; int n; char** value; } OrderedStream; OrderedStream* orderedStreamCreate(int n) { OrderedStream* obj=(OrderedStream*)calloc(sizeof(OrderedStream),1); obj->value=(char**)calloc(n+1,sizeof(char*)); obj->n=n+1; obj->cur=1; return obj; } char ** orderedStreamInsert(OrderedStream* obj, int id, char * value, int* retSize) { obj->value[id]=value; int i; for(i=obj->cur; i<obj->n && obj->value[i]; i++); *retSize=i-obj->cur; obj->cur=i; return obj->value+id; } void orderedStreamFree(OrderedStream* obj) { free(obj); }
标签:div mcr char int col value cal 有序 calloc
原文地址:https://www.cnblogs.com/ganxiang/p/14018679.html