주석有)링크드리스트를 활용한 간단한 학생관리 프로그램(입력,출력,검색,삭제) c언어,프로그래밍,학생관리
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
해당 자료는 10페이지 까지만 미리보기를 제공합니다.
10페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

주석有)링크드리스트를 활용한 간단한 학생관리 프로그램(입력,출력,검색,삭제) c언어,프로그래밍,학생관리에 대한 보고서 자료입니다.

목차

[Debug]
  test1.exe
  test1.exe.lastcodeanalysissucceeded
  test1.ilk
  test1.pdb
[ipch]
  [test1-9fb8824a]
[test1]
  [Debug]
  ReadMe.txt
  stdafx.cpp
  stdafx.h
  targetver.h
  test1.cpp
  test1.vcxproj
  test1.vcxproj.filters

test1.sdf
test1.sln
test1.v11.suo


파일 39, 폴더 5
13.0MB

본문내용

test1.cpp



// test1.cpp : 콘솔 응용 프로그램에 대한 진입점을 정의합니다.
//

#include \"stdafx.h\"
#include
#include

typedef struct student{
char name[255];
int num;
student *next;
}stud;
// 구조체를 선언하는 부분. 멤버는 name과 num 두개과 다음 노드를 가리키고 있는 next.

//입력함수. 매개변수로 head를 받아 입력시키고 다시 리턴한다.
stud* input(stud *head){
    if(head==NULL){ // 노드가 하나도 없는경우는 head가 NULL값이기때문에 바로 head에 입력한다.
        stud *d = (stud *) malloc(sizeof(stud));
        printf(\"이름 : \");
        gets_s(d->name,255);
        printf(\"\\n번호 : \");
        scanf_s(\"%d\",&d->num);
        fflush(stdin);
        d->next=NULL;
        return d;
    } else { //head가 NULL이 아닌 경우에는 head의 다음 노드를 입력함수에 넘겨준다. 그렇게 계속 넘겨서 빈 노드까지 간 후에 입력하는 방식.
        head->next = input(head->next);
    }

    return head;
}

//전체 출력하는 함수. 간단하게 출력하고 다음 노드로 이동하면서 이동할 노드가 비어있는지만 확인하고 비어있으면 종료한다.
void output(stud *head){
    stud *temp = head;
    while(!(temp==NULL)){
        printf(\"%s %d\\n\",temp->name, temp->num);
        temp=temp->next;
    }
}

//번호로 검색하는 함수. 매개변수로 head와 검색할 번호를 받는다.
//처음부터 하나씩 거치면서 찾는 번호와 일치하는지 검사한다. 찾는 번호가 아니면 다음으로 넘어가고 맞으면 그 데이터를 출력하고 종료.
stud* find(stud *head, int f){

    stud *temp = head;

    while(!(temp==NULL)){
        if(temp->num == f){
            printf(\"%s %d\\n\",temp->name, temp->num);
            return temp;
        }
        temp=temp->next;
    }
    printf(\"찾는 데이터 없음\\n\"); //찾는 데이터가 없을때는 그냥 종료.
    return temp;
}
  • 가격3,000
  • 페이지수39페이지
  • 등록일2014.06.23
  • 저작시기2014.6
  • 파일형식압축파일(zip)
  • 자료번호#925645
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니