Stop Memsetting Structures
Consider this snippet of code from the venerable Beej’s Guide to Network Programming:
So, we first declare a struct, memset it to zero and then initialize the fields we are interested in. But if you’re writing new code in 2019, there is really no reason to not use designated initializers. Cue the Rust Evangelism Strike Force chiming in to say that there is really no reason to be writing new C code in 2019.
Source: www.anmolsarma.in