#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct Time{
char name[30];
int pnts;
int vit, emp, der;
int gf, gt;
struct Time *next;
struct Time *prev;
typedef struct campeonato
{ time *first
; } campeonato
;
void addTime(campeonato *c, char name[]) {
t->next = NULL;
t->pnts = t->vit = t->emp = t->der = t->gt = t->gf = 0;
if (c->first == NULL) {
c->first = t;
t->prev = NULL;
} else {
while (p->next != NULL) p = p->next;
p->next = t;
t->prev = p;
}
}
int main(void) {
campeonato c = { .first = NULL };
addTime(&c, "Santos");
}
//https://pt.stackoverflow.com/q/162373/101
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHN0cmluZy5oPgoKdHlwZWRlZiBzdHJ1Y3QgVGltZXsKICAgIGNoYXIgbmFtZVszMF07CiAgICBpbnQgcG50czsKICAgIGludCB2aXQsIGVtcCwgZGVyOwogICAgaW50IGdmLCBndDsKICAgIHN0cnVjdCBUaW1lICpuZXh0OwogICAgc3RydWN0IFRpbWUgKnByZXY7Cn0gdGltZTsKCnR5cGVkZWYgc3RydWN0IGNhbXBlb25hdG8geyB0aW1lICpmaXJzdDsgfSBjYW1wZW9uYXRvOwoKdm9pZCBhZGRUaW1lKGNhbXBlb25hdG8gKmMsIGNoYXIgbmFtZVtdKSB7CiAgICB0aW1lICp0ID0gbWFsbG9jKHNpemVvZih0aW1lKSk7CglzdHJjcHkodC0+bmFtZSwgbmFtZSk7CiAgICB0LT5uZXh0ID0gTlVMTDsKICAgIHQtPnBudHMgPSB0LT52aXQgPSB0LT5lbXAgPSB0LT5kZXIgPSB0LT5ndCA9IHQtPmdmID0gMDsKICAgIGlmIChjLT5maXJzdCA9PSBOVUxMKSB7CiAgICAJYy0+Zmlyc3QgPSAgdDsKCSAgICB0LT5wcmV2ID0gTlVMTDsKICAgIH0gZWxzZSB7CgkgICAgdGltZSAqcCA9IGMtPmZpcnN0OwogICAgCXdoaWxlIChwLT5uZXh0ICE9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