소개글
C 언어를 이용한 주소록 관리 프로잭트 입니다.공부하는데 많은 도움이 되었으면 합니다.
소스 뿐만 아니라 설계서도 포함되어 있습니다.
프로잭트를 진행하려는 저같은 초급 프로그래머들에게
많은도움이 될것이라고 생각합니다.
소스의 일부입니다.
BOOL Address_Insert(PersonInfo Data, Address *pSelf)
{
BOOL Success = TRUE;
int i;
for(i = 0 ; i < pSelf->nCount ; i++)
{
if( PersonInfo_Cphone_Equal( Data.szCellPhone, &pSelf->List[i] ) == TRUE )
{
Success = FALSE;
break;
}
}
if( Success == TRUE)
{
PersonInfo_Write(Data.szName, Data.szAddress, Data.szCellPhone, Data.szPhone, Data.szBirth, Data.szNateID , &(pSelf->List[pSelf->nCount]) );
pSelf->nCount++;
}
return Success;
}
void Address_Modify(PersonInfo Dest, PersonInfo *pSelf)
{
pSelf->PersonInfo_Rewrite(Dest.szName, Dest.szAddress,Dest.szCellPhone, Dest.szPhone, Dest.szBirth, Dest.szNateID, pSelf);
}
void Address_View(PersonInfo **ppTemp, Address *pSelf)
{
int i;
*ppTemp = (PersonInfo *)malloc(sizeof(PersonInfo) * pSelf->nCount );
for ( i = 0 ; i < pSelf->nCount ; i++)
{
*(*ppTemp+i) = pSelf->List[i];
}
}
int Address_Name_Search(char *szName, Address *pSelf, PersonInfo **ppTemp)
{
int i;
int nCounter = 0;
for( i = 0 ; i < pSelf->nCount ; i++)
{
if( PersonInfo_Name_Equal( szName, &pSelf->List[i] ) == TRUE )
{
nCounter++;
}
}
if(nCounter > 0)
{
*ppTemp = (PersonInfo *)malloc(sizeof(PersonInfo) * pSelf->nCount);
nCounter = 0;
for( i = 0 ; i < pSelf->nCount ; i++)
{
if( PersonInfo_Name_Equal(szName, &pSelf->List[i] ) == TRUE)
{
*(*ppTemp+nCounter) = pSelf->List[i];
nCounter++;
}
}
}
return nCounter;
}
void Address_Delete(Address *pSelf, int nLocation)
{
pSelf->List[nLocation] = pSelf->List[pSelf->nCount - 1];
pSelf->nCount--;
}
컴파일 실행환경
Visual Studio 6압축파일 내 파일목록
DFD_주소록관리.hwp
주소록관리_ns차트.hwp
주소록관리/Address.c
주소록관리/Address.h
주소록관리/interface.c
주소록관리/interface.h
주소록관리/main.c
주소록관리/PersonInfo.c
주소록관리/PersonInfo.h
주소록관리/Personinfo.txt
주소록관리/주소록관리.dsp
주소록관리/주소록관리.dsw
주소록관리/주소록관리.ncb
주소록관리/주소록관리.opt
주소록관리/주소록관리.plg
주소록관리/Debug/Address.obj
주소록관리/Debug/interface.obj
주소록관리/Debug/main.obj
주소록관리/Debug/PersonInfo.obj
주소록관리/Debug/Personinfo.txt
주소록관리/Debug/vc60.idb
주소록관리/Debug/vc60.pdb
주소록관리/Debug/주소록관리.exe
주소록관리/Debug/주소록관리.ilk
주소록관리/Debug/주소록관리.pch
주소록관리/Debug/주소록관리.pdb
주소록관리_ns차트.hwp
주소록관리/Address.c
주소록관리/Address.h
주소록관리/interface.c
주소록관리/interface.h
주소록관리/main.c
주소록관리/PersonInfo.c
주소록관리/PersonInfo.h
주소록관리/Personinfo.txt
주소록관리/주소록관리.dsp
주소록관리/주소록관리.dsw
주소록관리/주소록관리.ncb
주소록관리/주소록관리.opt
주소록관리/주소록관리.plg
주소록관리/Debug/Address.obj
주소록관리/Debug/interface.obj
주소록관리/Debug/main.obj
주소록관리/Debug/PersonInfo.obj
주소록관리/Debug/Personinfo.txt
주소록관리/Debug/vc60.idb
주소록관리/Debug/vc60.pdb
주소록관리/Debug/주소록관리.exe
주소록관리/Debug/주소록관리.ilk
주소록관리/Debug/주소록관리.pch
주소록관리/Debug/주소록관리.pdb