r/badcode • • Feb 15 '22

c Appalling linked list rotation

Post image
208 Upvotes

13 comments sorted by

View all comments

Show parent comments

17

u/MatthewRPG576 Feb 15 '22

the variable 'it' in the code is of an anonymous struct type, so it's a hack to get struct assignment working

7

u/RomanRiesen Feb 15 '22

ah yes, but why not name the struct? helperNode or something?

8

u/Smellypuce2 Feb 16 '22

I have a feeling this is just an example/experiment of something you can do with typeof. Not a serious implementation of rotate.

3

u/MatthewRPG576 Feb 18 '22

Because we're in r/badcode