프로젝트 일상

C# 기말 팀 프로젝트가 정해졌다.

psp가 원작이라던 루미네스 게임.

과연 CLR 기반으로 돌아가는 C#에서 엔진없이 얼만큼이나 잘 돌아갈련지 모르겠다.

코딩의 90%이상을 또 내가 할거같은 불안감도 들고...

기술면접 프로젝트 선행공부도 해야하는데, 이런저런게 겹쳐 바쁘다보니, 완성도가 얼마나 될지도 궁금하고...

일단은 윈폼을 좀 연구하고 도전해봐야겠다.

오랜만에 쓰기는 하는데 일상

딱히 이글루쪽에 아는사람이 있는것도 아니고 ...

요즘에도 그냥 네이버 씁니다.

아무래도 네이버쪽이 아는사람이 많아서, 팔이 굽더군요.


어쨋든, 최근에는,

... 그냥 그럭저럭 살아가고 있습니다.

어느새 던파는 접은지 8달이 다되어가네요.

지금 생각해보면, 진작에라도 빨리 정리했던것이 나았던것 같기도 하고.


학교 다니면서 공부하는데 맛이 들었다고나 할까 ...

기술면접 준비하고 있다고나 할까 ...

다들 바쁘게 살아가겠지만, 바쁜건 좋은것이라 생각합니다.

허둥지둥 하면서 살아가도, 역동적이니까 좋은거죠. :)


이번해만 잘 넘기면,

이번해에 붙기만 하면,

부모님 등골을 조금이라도 덜 빼먹을것 같기도 해서 -_- ...

얼른 얼른 정진해야죠.

아...!

생강빵을 배워야겠네요.

아이폰 유저지만,

그런것은 아무래도 상관없습니다.

자연인!! 미분류

오늘에서야 마지막 시험도 다 끝났고 ... 

C만 받아도 감사감사 하려고 했던 과목이 ...

A가 나와서 정말 기분이 날아갈듯 ...

응앜 교수님 사랑해요. ^^;

 

하지만 ...

교수님과 한바탕 싸웠던 과목은 F 확정이고 ...

응용미적분학도... 어떻게 될지 모르겠음... -_-... 젭알 이때까지 성실하게 수업나온것을 감안해서 C라도 주시면... 헤헤...

 

하...

그래도 이번학기는 어찌어찌 잘 넘긴 모양.

6과목중 3과목이 A, A+, A+이니... 한과목따위 F떠도 뭐... 

이제 맘놓고 네트워킹과 소켓을 공부할 수 있겠음. ^ㅅ^


싱글 링크드 리스트 연습 C

헤더파일부
  1. #ifndef _LIST_H_
  2. #define _LIST_H_
  3.  
  4. #include <iostream>
  5. #include <cstring>
  6.  
  7. using std::cout;
  8. using std::cin;
  9. using std::endl;
  10.  
  11. struct node
  12. {
  13.  
  14.     int num;
  15.     char name[20];
  16.     node* next;
  17.  
  18. };
  19.  
  20. node* InitNode(void);
  21. node* insertNode(node* head);
  22. void printNode(node* head);
  23. node* deleteNode(node* head, const char name[]);
  24. void deleteAllNode(node* head);
  25.  
  26. typedef struct node Node;
  27.  
  28. #endif

 

함수부

  1. #include "list.h"
  2.  
  3. node* InitNode(void)    // 헤드 초기화
  4. {
  5.     node* head;
  6.     head = new node;
  7.    
  8.     strcpy(head->name, "");
  9.     head->next = NULL;
  10.     head->num = 0;
  11.  
  12.     return head;
  13. }
  14.  
  15. node* insertNode(node* head)    // 노드 삽입
  16. {
  17.     node* temp = head;
  18.    
  19.     temp->next = new node;
  20.     cout<<"이름입력 : ";
  21.     cin>>temp->next->name;
  22.     cout<<"번호입력 : ";
  23.     cin>>temp->next->num;
  24.  
  25.     temp->next->next = NULL;
  26.  
  27.     return temp->next;
  28. }
  29.  
  30. void printNode(node* head)
  31. {
  32.     if(head == NULL)
  33.     {
  34.         cout<<"노드부터 할당하세요."<<endl;
  35.         return;
  36.     }
  37.  
  38.     node* temp = head->next;
  39.    
  40.     cout<<"번호   이름"<<endl;
  41.  
  42.     while(temp)
  43.     {
  44.         cout<<temp->num<<"  "<<temp->name<<endl;
  45.         temp = temp->next;
  46.     }
  47. }
  48.  
  49. node* deleteNode(node* head, const char name[])
  50. {
  51.     node* current = head;
  52.     node* temp = head;
  53.     node* prev = NULL;
  54.     node* del;
  55.  
  56.     while(current)
  57.     {
  58.         if(!stricmp(name, current->name))   break;
  59.         prev = current;
  60.         current = current->next;
  61.     }
  62.  
  63.     if(current == NULL)
  64.         cout<<"찾는 노드가 없습니다."<<endl;
  65.  
  66.     else if(prev == NULL)   // 삭제하는 노드가 첫노드일 시.
  67.     {
  68.         del = current;
  69.         current = current->next;
  70.         delete del;
  71.  
  72.         return current;
  73.     }
  74.    
  75.     else
  76.     {
  77.         del = current;
  78.         current = current->next;
  79.         prev->next = current;
  80.         delete del;
  81.     }
  82.  
  83.     return temp;
  84. }
  85.  
  86. void deleteAllNode(node* head)
  87. {
  88.     if(head->next == NULL)  return;
  89.     head = head->next;
  90.     cout<<head->name<<" 삭제"<<endl;
  91.     deleteAllNode(head);
  92.     delete head;
  93. }

 

메인부

  1. #include <iostream>
  2. #include "list.h"
  3.  
  4. int main(int argc, char* argv[])
  5. {
  6.     node* head = NULL;
  7.     node* data;
  8.     int choice;
  9.     bool flag = true;
  10.     char str[20];
  11.  
  12.     head = InitNode();
  13.  
  14.     data = head;
  15.  
  16.     while(true)
  17.     {
  18.         cout<<endl<<"1. 노드 생성"<<endl;
  19.         cout<<"2. 노드 출력"<<endl;
  20.         cout<<"3. 노드 선택 삭제"<<endl;
  21.         cout<<"4. 노드 전체 삭제"<<endl;
  22.         cout<<"5. 나가기"<<endl;
  23.         cout<<"메뉴 입력 : ";
  24.         cin>>choice;
  25.  
  26.         switch(choice)
  27.         {
  28.         case 1 :
  29.             data = insertNode(data);
  30.             break;
  31.  
  32.         case 2 :
  33.             printNode(head);
  34.             break;
  35.  
  36.         case 3 :
  37.             cout<<"삭제할 이름 입력 : ";
  38.             cin>>str;
  39.             head = deleteNode(head, str);
  40.             break;
  41.  
  42.         case 4 :
  43.             deleteAllNode(head);
  44.             break;
  45.  
  46.         case 5 :
  47.             cout<<"프로그램 종료"<<endl;
  48.             flag = false;
  49.             break;
  50.  
  51.         default :
  52.             cout<<"잘못입력"<<endl;
  53.         }
  54.     }
  55.  
  56.     return 0;
  57. }

 

혼자 독학으로 연습중인데 ...

 

생각보다 재밌는듯.

 

분석은 심심하고 시간나면 해보도록 하겠습니다.


1 2 3 4 5 6 7 8 9 10 다음