This does not do what you think it does. It should cause a segmentation fault.Originally Posted by rothj0hn
You're telling scanf() that you want to put a string at the address stored in num[4], which is beyond the end of the array num[], and is also a char, not a pointer.
I'll leave it to others to explain why making num[] only 4 elements long is a bad idea.