struct A
{
int a;// 裝備
int b;// 角色數(shù)據(jù)
char c;
};
void main( void )
{
//printf("hello world!");
char buffer[] = "This is a test of the memset function";
A aStruct;
// 發(fā)現(xiàn)數(shù)據(jù)相同。
memset(&aStruct,'*',sizeof(aStruct));
printf( "Before: %s\n", buffer );
memset( buffer, '*', 4 );
printf( "After: %s\n", buffer );
if (buffer[2] == '*')
{
printf("hello,world\n");
}
// 判斷這個(gè)是否要保存。
if (aStruct.a == 0x2a2a2a2a)
{
// 發(fā)送給DBSERVER.
printf("hello char\n");
}
if (aStruct.c == 0x2a)
{
}
getchar();