strcpy拷贝的是一个有符号的字符字符串,而不是一个无符号的字符串

#include "stdafx.h"
#include<stdio.h>

#include<stdlib.h>
#include<string.h>
#pragma pack(1)
typedef struct EMPTYSTRUCT
{
int a;
char b;
unsigned char cLeadingCharacter[4];
}EmptyStruct;
int _tmain(int argc, _TCHAR* argv[])
{
EmptyStruct emptystruct;
memset(&emptystruct,0,sizeof(emptystruct));
strcpy(emptystruct.cLeadingCharacter,"ESVC");
    printf("%d\n",emptystruct.a);
printf("%d\n",emptystruct.b);
return 0;
}
1>c:\users\jack\desktop\vector\vector\vector.cpp(22): error C2664: 'strcpy' : cannot convert parameter 1 from 'unsigned char [4]'

你可能感兴趣的:(String,拷贝)