본문 바로가기

adhoc aaa 더보기
Inheritance vs Composition Inheritance vs Composition 더보기
프로그래머가 되는 방법: 짧고 폭넓고 개인적인 요약. How to be a Programmer: A Short, Comprehensive, and Personal Summary 프로그래머가 되는 방법: 짧고 폭넓고 개인적인 요약. http://samizdat.mines.edu/howto/HowToBeAProgrammer.pdf 번역 처로 강창기 Copyright ⓒ 2002, 2003 Robert L. Read Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundat.. 더보기
망고64에 u-boot 포팅하기 /* 이 자료는 http://blog.naver.com/PostList.nhn?blogId=yhoh&categoryNo=19¤tPage=3 의 푸우 님의 자료를 거의 복사 하였으니 참고해 주시기 바랍니다. */ U-Boot 란? Directory Structure board : 플랫폼, 보드 레벨 파일들. lib /board 로 부터 불리우는 모든 개별 보드의 초기화 함수을 포함 board// : 개별 보드를 위한 세부 보드 정보 (serial, asm_init.s, config.mk, flash.c etc) common : 모든 커맨드 (cmd_boot.c, cmd_date.c, env.c main.c etc) cpu : CPU 상세 정보 (cpu.c cpu_init.c, cache.s, i.. 더보기
[SourceInsight] 한글주석달기 매크로 설정하기 1. source insight에서 Project->Open Project->Base 를 오픈합니다. 2. Base 프로젝트에 포함되어 있는 Utils.em 파일을 Open합니다. 3. 다음과 같은 코드를 추가합니다. /* HANGULCMT */ /**------------------------------------------------------------------------ 한글 주석 만들기 - 쁘렉키!! 쀍 만든이 : 단국대학교 MAZE 10기 전유훈 _2007/6/20_ -------------------------------------------------------------------------*/ macro hangulcmt() { sCmt = ask("한글 주석을 입력 하세요"); sC.. 더보기
C언어 파일 입출력 고려할것 FILE *fp; fp -------------------> _ptr : 현재 가리키고 있는 byte _cnt : 남은 바이트수(_cnt로는 EOF을 알수 없음 buffersize의 남은 byte수) _base : buffer의 첫 byte _flag : 파일의 현 상태를 나타냄 _file : fd 번호(파일디스크립터) EOF는 무슨근거로?? -> 시스템에서 파일의 크기를 알 수 있다. 파일에서 -1값을 잃어 온 것이 아니라 시스템파일의 끝을 탐지해내서 -1을 받아온 것이다. int ch; while((ch = fgetc(fp)) != EOF) { } 여기서 ch가 int형인 이유가 있다. text파일에는 상관이 없지만 바이너리 파일을 이용할 때는 0xff 패턴이 있다. char형으로는 0xff는 -1이.. 더보기
union 활용법 1. 상호배타적인 상황에서 사용, 메모리최적화에 응용할 수 있다. flag를 이용해 상호배타적으로 사용한다. 2. union을 이용하면 parcing이 용이하다. //2번째 용도 예 #if 1 typedef union { int i; char c[4]; }u; int main(void) { int i; u u; u.i = 0x12345678; for(i = 0; i 더보기
mutable 상수 멤버 함수에서 mutable 데이터 멤버 일 경우에는 수정이 가능하다. class CTextBook { public: ... std::size_t length() const; private: char * pText; mutable std::size_t textlength; mutable bool lengthIsValid; }; std::size_t CTextBook::length() const //상수 멤버 함수 { if(!lengthIsValid){ textLength = std::stelen(pText); lengthIsValid = true; } return textlength; } 더보기
const_iterator std::vector vec; ... const std::vector::iterator iter = vec.begin(); //iter 는 T* const 처럼 동작 *iter = 10; //동작 ++iter; //에러 std::vector::const_iterator cIter = vec.begin(); //cIter는 const T* 처럼 동작 *cIter = 10;//에러 ++cIter;//동작 더보기
클래스와 static멤버, 클래스 상수 정의 const char * const Name = "feelpass"; const std::string Name("feelpass"); #include using namespace std; class Person { char name[20]; int age; static int count; public: Person(char* _name, int _age) { strcpy(name, _name); age = _age; cout 더보기