I cant add an item to array of struct and couldnt figure out why. This is how it looks like: Struct:
typedef struct node
{
char *data;
int count;
};
Array initialization:
struct node* list = malloc(100 * sizeof(struct node));
Add Part: (buffer is read from file)
fscanf( fp, "%s", &buffer);
list[ index].data = (char*)malloc(strlen( buffer));
strcpy( list[ index].data, buffer);
list[ index].count = 0;
index++;