반응형

2016/06/11 14

회원 관리 프로그램, STL map 사용 (인덱스 연산) [C++ 소스]

회원 관리 프로그램, STL map 사용 [C++ 소스] "본문 내용"은 언제나 휴일 본 사이트에 있습니다.//ehglobal.h#pragma once#pragma warning(disable:4996)#include using std::string;#include using std::cout;using std::cin;using std::ostream;using std::endl;#include #include enum keydata{ NO_DEFINED,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,ESC}; //공통적으로 사용할 정적 메서드를 캡슐화한 클래스class ehglobal{public: static void clrscr();//화면을 지우는 메서드 static void timef..

회원 관리 프로그램, STL map 사용(insert, find, erase, iterator) [C++ 소스]

회원 관리 프로그램, STL map 사용 [C++ 소스] "본문 내용"은 언제나 휴일 본 사이트에 있습니다.//ehglobal.h#pragma once#pragma warning(disable:4996)#include using std::string;#include using std::cout;using std::cin;using std::ostream;using std::endl;#include #include enum keydata{ NO_DEFINED,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,ESC}; //공통적으로 사용할 정적 메서드를 캡슐화한 클래스class ehglobal{public: static void clrscr();//화면을 지우는 메서드 static void timef..

도서 관리 프로그림, 이진 탐색 트리 [C++ 소스]

도서 관리 프로그림, 이진 탐색 트리 [C++ 소스] "본문 내용"은 언제나 휴일 본 사이트에 있습니다.//ehglobal.h#pragma once#pragma warning(disable:4996)#include using std::string;#include using std::cout;using std::cin;using std::ostream;using std::endl;#include #include enum keydata{ NO_DEFINED,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,ESC}; //공통적으로 사용할 정적 메서드를 캡슐화한 클래스class ehglobal{public: static void clrscr();//화면을 지우는 메서드 static void timeflo..

퀵 정렬 (Quick Sort) 알고리즘 [C++ 소스]

퀵 정렬 (Quick Sort) 알고리즘 [C++ 소스] "본문 내용"은 언제나 휴일 본 사이트에 있습니다.//common.h#pragma once#include #include #include #include #include #include using namespace std; class Member{ string name; int num;public: Member(string name,int num) { this->name = name; this->num = num; } string GetName()const { return name; } int GetNum()const { return num; } void View()const { cout

STL list 흉내내서 만들기 [C++]

STL list 흉내내서 만들기 [C++] "본문 내용"은 언제나 휴일 본 사이트에 있습니다.//list.h#pragma oncenamespace ehlib{ template class list { struct node { Data data; node *prev; node *next; node(Data data=0) { this->data = data; prev = next = 0; } }; node *head; node *tail; int count; public: class iterator { node *now; public: iterator(node *now=0) { this->now = now; } Data operator *()const { return now->data; } operator n..

STL vector 흉내내서 만들기 [C++]

STL vector 흉내내서 만들기 [C++] "본문 내용"은 언제나 휴일 본 사이트에 있습니다.//vector.h#pragma oncenamespace ehlib{ template class vector { Data *base; size_t bcapacity; size_t bsize; public: class iterator { Data *pos; public: iterator(Data *pos=0) { this->pos = pos; } Data operator *()const { return *pos; } int operator-(const iterator &iter)const { return pos - iter.pos; } iterator &operator++() { pos++; return (*t..

라운드 로빈 스케쥴러 시뮬레이션 [C++]

라운드 로빈 스케쥴러 시뮬레이션 [C++] "본문 내용"은 언제나 휴일 본 사이트에 있습니다.//EHProcess.h#pragma once#include #include using namespace std; class EHProcess{ string pname; //프로그램 이름 const int tjob; //전체 작업량 const int cjob; //cpu 점유 시 수행가능 최대 작업량 int ntjob; //현재 남은 작업량 int ncjob; //현재 cpu 점유 시 수행가능 최대 작업량public: EHProcess(string pname,int tjob,int cjob); void IdleToReady();//Idle 상태에서 Ready 상태로 전이 int Running();//CPU를 점유..

원형 큐 [C++소스]

원형 큐 [C++소스] "본문 내용"은 언제나 휴일 본 사이트에 있습니다.//원형 큐#include using namespace std; class Queue{ int *buffer; const int size; int front; int rear; public: Queue(int size):size(size) { buffer = new int[size]; front = rear = 0; } ~Queue() { delete[] buffer; } bool Put(int data) { if(IsFull()) { return false; } buffer[rear] = data; rear = Next(rear); return true; } int Get() { if(IsEmpty()) { return 0; } ..

반응형