1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include "player.h" player_list* create_playerlist(void) { player_list* pl = malloc(sizeof(player_list)); memset(pl, 0, sizeof(player_list)); return pl; } void cleanup_playerlist(player_list* pl) { for(int i=0; i<MAX_PLAYERS; i++) free(pl->names[i]); free(pl); }