I cannot understand what exactly is the difference between the two following implementations:
char str[20] = "Hello World"; _strnset(str, '*', 5);
and
char str[20] = "Hello World"; memset(str, '*', 5);
They both give the following result:
Exit: ***** World!
Is there a preference between them?
source share