본문 바로가기

전체 글73

[C]파일 사이즈 구하기 파일 사이즈 구하기 - 같은 디렉토리에 존재하는 test.txt 파일의 크기를 구함 01: /* 02: * Description - get the file size 03: */ 04: 05: #include 06: 07: int main(void) 08: { 09: FILE *fpMe; 10: long len; 11: 12: // test.txt file open read and binary mode 13: if((fpMe = fopen("test.txt", "rb")) == NULL) 14: { 15: printf("file open fail\n"); 16: return 0; 17: } 18: else 19: { 20: printf("file open success\n"); 21: } 22: 23: /.. 2009. 5. 27.
[WinApi]apiStart apiStart.cpp from http://www.winapi.co.kr 01: #include 02: 03: LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM); 04: HINSTANCE g_hInst; 05: LPSTR lpszClass="Class"; 06: 07: int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance 08: ,LPSTR lpszCmdParam,int nCmdShow) 09: { 10: HWND hWnd; 11: MSG Message; 12: WNDCLASS WndClass; 13: g_hInst=hInstance; 14: 15: WndClass.cbClsExtra=0; 16: Wn.. 2009. 5. 27.
[C]File merge // 두개의 파일을 읽어서 하나의 파일로 합치는 코드 01: /* 02: * description : 두 개의 파일을 읽어서 merge 03: */ 04: 05: 06: #include 07: 08: #define FILEREAD 4096 // buffer size define 09: 10: void main(void) 11: { 12: 13: FILE *fpR1, *fpR2, *fpW; 14: char buff[FILEREAD]; 15: int len; 16: 17: // first file read 18: fpR1 = fopen("C:\\test.exe","rb"); 19: if(fpR1 == NULL) 20: { 21: perror("first file read fail"); 22: return; .. 2009. 5. 27.
졸리고, 배고프고... 외롭고. '대체... 왜 이러고 사는거냐?' 속으로 되내이지만 답이 안보이네.. 정신적으로 충격을 받아서 그런가? ㅎㅎ 암만 봐도 난 요즘 정상이 아닌거 같아~ ㅡㅡ; 에이 그냥 자자~. 2009. 5. 27.
반응형