All pastes #269437 Raw Edit

Something

public text v1 · immutable
·published 2006-12-06 16:18 UTC
rendered paste body

#include <stdio.h>
#include <stdlib.h>


typedef struct {
int hp;
} stats;

void loadSavedGame(char *name, stats *player) {
/*      FILE *game;
        char *filename;

        filename = malloc(10 + sizeof(name));
        (sprintf(filename, "savedgames/%s",name);
        if((name = fopen(filename,"r")) == NULL) {
                printf("You don't have a saved game under that name.\n");
                exit(1); // will replace this later, it's not important right now
                }

        free(filename);
*/
        player->hp = 119;
        printf("worked %i\n",player->hp);
}

main() {
        char boo[10] = "oorza";
        stats playeer, *player;
        player = &playeer;
        loadSavedGame(boo, player);
        printf("%i\n",player->hp);
}