(a)
#include <stdio.h>
#include <string.h>
#include <strsafe.h>

void main()
{
   char str[10];
   strcpy(str, "hello");
   puts(str);
}

(b)
error C2065: 'strcpy_instead_use_StringCbCopyA_or_StringCchCopyA' : 						undeclared identifier

(c)
#undef strcpy
#define strcpy strcpy_instead_use_StringCbCopyA_or_StringCchCopyA; 

Example 2: Although (a) is valid code, the compiler complains with the message in (b). The header defines (c).

Back to Article