You declare i as a pointer to a node (But haven't actually assigned memory for it, so it's now pointing to some garbage location), but then you immediately try to point it to its own NEXT pointer.
Again, with *temp, you need to create the object before you can assign it values.