본문 바로가기

C.O.M.P.U.T.E.R

[0] |C++| 숫자정렬 프로그램 .cpp 파일 (2/2) #include "Csort.h" void cSort::_init() { Sort.Count = 0; Sort.UpDown = 0; cout > Sort.Count; Sort.Num = (int *)malloc(sizeof(int)*Sort.Count); int i = 0; while(i Sort.UpDown; switch(Sort.UpDown) { case 1: for(int x = 0; x < Sort.Count - 1 ; x++) for(int y = x + 1 ; y < So.. 더보기
[0] |Objective-C| 숫자정렬 프로그램 .h 파일 (1/2) #import @interface cSort : NSObject { @private int *Num; int Count; int UpDown; } -(void) _sort; -(void) _swap:(int *)n1:(int *)n2; -(void) _print; @end 프로그램 공부는 즐겁지만... 너무 진도가 빨라서 따라기질 못하겟네요... 약 6일동안「C/C++」를 끝내고 약5일 동안「Objective-C」를 끝내고 8일동안「API」... 그 외... 더보기
[0] |Objective-C| C언어와 Objective-C언어와의 차이점 #import @interface MyClass : NSObject { // 멤버 변수 int x, y; } // 멤버 메소드 추가부분 // C언어 -> void method(); -(void)method; @end // 멤버 메소드에 대한 사양 @implementation MyClass -(void)method { NSLog(@"MyClass method\n"); } @end int main(int argc, char *argv[]) { MyClass *cls; // instance 인스턴스 // C언어 -> cls = new MyClass; cls = [MyClass alloc]; // C++언어 -> cls.method(); [cls method]; /* pritnf("Hello Apple\n");.. 더보기
[0] |C++| 숫자정렬 프로그램 .h 파일 (1/2) #include using namespace std; class cSort { private: int *Num; int Count; int UpDown; public: void _init(); void _sort(); void _swap(int *n1, int *n2); void _print(); }; 아주 간단한 정렬 프로그램 입니다. 숫자만 받을 수 있고요.「xCode」로 만들었습니다.「MAC」... 더보기
[0] |C++| 숫자야구게임 프로그램 .cpp 파일 (2/2) #include "Cbaseball.h" void cBaseball::_init() { Strike = 0; Ball = 0; RandomNum[NUMBER_MAX] = 0; UserNum[NUMBER_MAX] = 0; } void cBaseball::_random() {z srand((unsigned)time(NULL)); int NumberChk[NUMBER_MAX] = { 0 }; int RandomInit = 0; int Loop = 0; while(Loop < NUMBER_MAX) { RandomInit = rand()%PLAY_MAX; if(NumberChk[Loop] == 0) { NumberChk[Loop] = 1; RandomNum[Loop] = RandomInit + 1; Loop++;.. 더보기