Question: I can't seem to find how to free() the sub struct.

Structs:

```
typedef struct
{
    char ID[5];
    location *loc;
} observer;

typedef struct
{
    double lat;
    double lng;
} location;

```

My Wrapper of Free() is:

```
void free_obs_list_node(void *data)
{
    free(*(observer **)data);
}

```

I can free the observer struct. I cannot free the pointer to the location Struct. This is my question: how do I free the `location` struct pointed to by `location *loc;`

I used a wrapper of `free()` as these are node's in a generic linked list.

Answer: 
That doesn't work because [Set](https://docs.oracle.com/javase/7/docs/api/java/util/Set.html) is an interface and you can't instantiate interfaces.

You have to use one of the classes that implement the `Set` interface, for example, `TreeSet`:

```
character = new TreeSet<Character>();

```

Or `HashSet`:

```
character = new HashSet<Character>();

```

BTW, it would be good idea to make `character` private instead of public (see [Encapsulation](http://en.wikipedia.org/wiki/Encapsulation_%28object-oriented_programming%29)).
`Set` is interface. so you can not create it with new. you need a implemented object. `HashSet` can be useful.

```
public class dungeon{ 
   public Set<Character> character;    
   public dungeon(){
      super();
      character =  new HashSet<String>();
   }
}

```