Whenever I look at real code or example socket code in books, man pages and websites, I almost always see something like:
struct sockaddr_in foo; memset(&
Either one is correct as many have pointed out. Additionally you can allocate these structures with calloc which already returns a zeroed memory block.