As Sergey said, don't copy code from one language when you are trying to learn another.
You will end up in a conversion mess, as you already noticed.
It is better you try to find examples in C and go from there.
If your first obstacle is a linked list, you can take a look at the following sites:
g/en/Linked_lists" target="_blank" title="New Window">^]
Lesson 15: Singly linked lists in C[
^]
Linked lists in C[
^]
Good luck.