KakaoTalk_20190606_001802318.png
  • 246x0w
Welcome
Curriculum
Install&Go
Board
실제 작동 상태를 확인하려면 라이브 사이트로 이동하세요.
  • 카테고리
  • 전체 게시물
  • 내 게시물
wimpy15
2020년 5월 16일

dd

게시판: 소스 코드 제출

/*

#include <stdio.h>

#include <stdlib.h>


int main()

{

printf("Hello world!\n");

return 0;

}

*/

/*

#include <stdio.h>


struct node

{

int num;

struct node*link;

};


int main()

{

struct node a, b;

a.num = 0;

a.link = &b;

b.num = 1;

printf("%d",a.link -> num);

return 0;

}

*/

#include <stdio.h>

#include <stdlib.h>

#include <string.h>


typedef struct listNode

{

char data[10];

struct listNode* link;

} listNode;

typedef struct

{

listNode* head;

}linkedlist_h;


linkedlist_h*createLinkedList_h(void);

void freeLinkedList_h(linkedlist_h*);

void addLastNode(linkedlist_h*,char*);

void reverse(linkedlist_h*);

void deleteLastNode(linkedlist_h*);

void printList(linkedlist_h*);


linkedlist_h* createLinkedList_h(void)

{

linkedlist_h* L;

L = (linkedlist_h*)malloc(sizeof(linkedlist_h));

L->head=NULL;

return L;

}

void addLastNode(linkedlist_h* L,char* x)

{

listNode* newNode;

listNode* p;

newNode = (listNode*)malloc(sizeof(listNode));

strcpy(newNode->data,x);

newNode ->link=NULL;

if(L->head==NULL)

{

L->head = newNode;

return;

}

p = L->head;

while(p->link != NULL)

{

p = p ->link;

}

p -> link = newNode;

}

댓글 0개
0
댓글
댓글 0개
유사 게시물
  • dd
  • dd
  • dd
주소 : 경기도 용인시 광교중앙로 302 블루 스퀘어 602호
연락처 : 031) 216 - 1546
사업자등록번호 : 465-92-00916
​학원 등록 제 4603호