11/11/06 07:23:07.35
>>26
#include <string.h>
#include <stdlib.h>
typedef struct AAA {
char usr_name[32];
char password[32];
int age
}AAA;
char* strlcpy( char* pDestination, const char* pSource, size_t Size )
{
char* pStart = pDestination;
while( --Size && ( *pDestination++ = *pSource++ ) );
*pDestination = '\0';
return pStart;
}
AAA usr; /*グローバル変数*/
void init(){
/*作成*/
memset(&usr,0,sizeof(AAA));
}
int add_user(char *usr_name,char *password,int age){
/*作成*/
strlcpy(usr.usr_name,usr_name,32);
strlcpy(usr.password,password,32);
usr.age = age;
}