char a[17]={0};
char b[17]={0};
char c[33]={0};
strncpy(a,"0123456789abcdef",sizeof(a));
a[sizeof(a)-1] = '\0';
strncpy(b,"0123456789abcdef",sizeof(b));
b[sizeof(b)-1] = '\0';
strcpy(c,a);
strcat(c,b);
cout << c<< endl;
return 0;
vs2012说我错误 1 error C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. h:\c++\2.2\2.2\2.2.cpp 13 1 2.2