Quantcast
Channel: C pointers segmentation fault crash - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by David Schwartz for C pointers segmentation fault crash

strcpy(director[i]->code, dataPtr[i]->code); //It crashes in this Line At this point, director[i] doesn't point to anything. You need a director[i] = calloc(... line just like in...

View Article


C pointers segmentation fault crash

// Struct for Country Datatypedef struct{ char name[50]; // Country name char code[3]; // Country code int population; // Country Population double lifeExp; // Country Life expectancy } CountryData;//...

View Article
Browsing all 2 articles
Browse latest View live