Hello! It's my first post and my First time browsing this forum.

I am doing a piece of homework for about a week. I'm having problems allocating memory for a structure. Segmentation fault is the error. Code from example is missing. Here are the relevant parts:

Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct file{
	char *name;
	int
...