city_t *new_city (const char *name) { city_t *ret = malloc(sizeof(city_t)); ret->name = name; ret->roads = NULL; //tymczasowe, TODO ret->visit = false; ret->distance = 0; ret->prev = NULL; ret->position = 0; ret->next = NULL; //TODO printf("adres reta %ld\n", ret); fflush(stdout); return ret; } int main () { city_t *a = new_city("Aa"); printf("adres a %ld\n", a); fflush(stdout); printf("%u %u", a->distance, a->position); //tu segfault, więc dalej whatever }