void* memset( void* str, int ch, size_t n);
Pointer to the object to copy the character.
The character to copy.
Number of bytes to copy.
Return value :
The memset() function returns str, the pointer to the destination string.
Here it is basically filling up whole ans array with 0 value.
You can fill up any array wit 0 or -1 using this method, but it doesn’t work for other numeric value.
But it can copy any character whatever you want to copy.
using namespace std;
char str = "freshlybuilt";
memset(str, 'a', sizeof(str));
cout << str;