Oct 4, 2017 11:38 AM
(This post was last modified: Oct 4, 2017 11:40 AM by theChive.)
Hey all, I'm stumped on a school assignment. I'm not looking for you to do my work for me, just a little nudge forward.
I have this struct that I need to create a linked list with and reverse it. Easy. However, the catch is that instead of having a pointer next to the next struct in the list, I have a void pointer that (required by my professor) points to the corresponding void pointer in the next struct in the list. I'm not sure how to even work this out.
Anyone have some suggestions for just getting my mind around this and getting started? Thanks!
Here's my header file:
Edit: The header file is given and can't be changed by me, by the way.
I have this struct that I need to create a linked list with and reverse it. Easy. However, the catch is that instead of having a pointer next to the next struct in the list, I have a void pointer that (required by my professor) points to the corresponding void pointer in the next struct in the list. I'm not sure how to even work this out.
Anyone have some suggestions for just getting my mind around this and getting started? Thanks!
Here's my header file:
Code
struct _Node {
union {
int n;
char c;
} val;
void *ptr;
int var;
};
typedef struct _Node Node;Edit: The header file is given and can't be changed by me, by the way.
Keep calm, chive on.


![[Image: m7EgqG6.png]](https://i.imgur.com/m7EgqG6.png)