I managed to use the memset()... but what the arguments signifies?
memset(buf, 0, sizeof(buf)) : why the 0 ? can we any other integer ? what happens when we use any other integer ?
- sri
: : Is there any other way available for initializing the buffer ?
:
: certainly. here are some
:
: char buffer[BUFSIZ];
: // initialize it
: for(int i = 0; i < BUFSIZE; i++)
: buffer[i] = 0;
:
: or
:
: char buffer[] = "Hello World";
:
: or
: char buffer[255] = {0} // only 1st byte set to 0
:
: