C/C++の宿題片付けます 153代目at TECH
C/C++の宿題片付けます 153代目 - 暇つぶし2ch27:デフォルトの名無しさん
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;
}


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch