원형 연결 리스트 활용 예 해석 부탁드립니다. 진짜도와주세요 ㅠ
텃골
typedef struch cnode *npointer;
struch cnode {
int rum;
char grade;
npointer link;
};
void insert_front(npointer node);
void c_printf();
void find_grade(char sgrade);
npointer ptr = NULL;main()
{
int cond=1 i;
npointer temp;
char sgrade;while (cond) {
temp = (npointer)malloc(sizeof(struct cnode));
printf(Enter id and grade : );
scanf(%d %c,&(temp -num), &(temp -grade));
insert_front(temp);
printf(Continue?(0/1) : );
scanf(%d,%cond);
}c_print();
printf(Enter grade to be searched : );
scanf( %c, &sgrade);
find_grade(sgrade);
}void find_grade(char sgrade)
{
nponter temp = ptr;
if (ptr) {
do {
if (temp -grade == sgrade)
printf(%d : %c\n, temp -num, temp -grade);
temp = temp - link;
}while (temp != ptr);
}
}void isenrt_front(npointer node)
{
if (!ptr) {
ptr = node;
node - link = node;
}
else {
node - link = ptr - link;
ptr - link = node;
}
}void c_print()
{
npointer temp = ptr;
if(ptr) {
do {
printf(%d : %c\n, temp -num , temp -grade);
temp = temp - link;
} while (temp - link;
}
}
번호 | 제 목 | 글쓴이 | 날짜 |
---|---|---|---|
2692451 | 이 문제좀 풀어주세요 ^^ | 게자리 | 2025-04-23 |
2692424 | 2차원배열 자료입력질문이요! (1) | 똘끼 | 2025-04-22 |
2692401 | 유닉스안에서 C언어를 이용한 명함 만들기 입니다; 이해안가는 부분이있네요 | 2gether | 2025-04-22 |
2692374 | 고수님들 댓글 마니부탁해요!!! (2) | 엄지 | 2025-04-22 |
2692343 | scnaf에 자꾸 선언을 참조하라는데;; (8) | 도래 | 2025-04-22 |
2692282 | 도스상에서 생성된 exe파일에 press~ 뜨게 하기 (4) | 회사원 | 2025-04-21 |
2692256 | scanf("%*c"); ㅠㅠ 고수님들 | 거북이 | 2025-04-21 |
2692230 | 하노이탑 질문입니다. (1) | 미쁘다 | 2025-04-21 |
2692210 | 정보 올림피아드 문제인데.. 풀이 과정이 궁금합니다.(재귀함수) (5) | 물티슈 | 2025-04-20 |
2692144 | C언어와 리눅스에 대한 질문입니다. | 싴흐한세여니 | 2025-04-20 |
2692114 | 컨텍스트 스위칭하는데 걸리는 시간 측정.. | YourWay | 2025-04-19 |
2692086 | 간접참조 연산자, 증감연산자 질문이용! (2) | 블랙캣 | 2025-04-19 |
2692056 | 주석좀 달아주세요. 몇개적엇는데 몇개만달아주세요. (2) | DevilsTears | 2025-04-19 |
2691978 | 진수 쉽게 이해하는법... (3) | 지지않는 | 2025-04-18 |
2691949 | getchar() 한 문자를 입력받는 함수 질문 | 채꽃 | 2025-04-18 |
2691919 | 배열 정렬 및 합치기 질문입니다. | 사과 | 2025-04-18 |
2691845 | c언어왕초보 질문이 있습니다........ | 루나 | 2025-04-17 |
2691815 | void add(int num); 함수... (4) | 살랑살랑 | 2025-04-17 |
2691756 | 명령 프롬프트 스크롤바가 없어요 | 두메꽃 | 2025-04-16 |
2691725 | 자료구조에 관련해서 질문이 있어 글을 올립니다. | 누리알찬 | 2025-04-16 |