This problem is not so strange - many beginners to C programming make the same mistake. Both codes obviously will just crash.

If you can't find the problem yourself, I'll give you a hint: You have defined a struct pointer, but where is its content?