What’s the usefulness of the function memset()?.
Definition: Sets the first num bytes of the block of memory pointed by ptr to the
specified value (interpreted as an unsigned char).
Does this mean it hard codes a value in a memory address?
memset(&serv_addr,0,sizeof(serv_addr) is the example that I’m trying to understand.
Can someone please explain in a VERY simplified way?
memset()is a very fast version of a relatively simple operation:That is,
memset(b, c, l)set thelbytes starting at addressbto the valuec. It just does it much faster than in the above implementation.