#include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char ch; FILE *fp, *ofp; fp=fopen("a.txt", "r"); //파일명과 사용할 권한 ofp=fopen("b.txt", "w"); // 이미파일이 있으면 내용을 삭제하고 새로 만든다.주의 // w 대신 a를 쓰면 append ! if(fp==NULL) exit(1); while(1) { ch=fgetc(fp); // OS가 생성한 버..
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char ch; FILE *fp; fp=fopen("a.txt", "r"); //파일명과 사용할 권한 if(fp==NULL) exit(1); while(1) { ch=fgetc(fp); // OS가 생성한 버퍼의 주소를 리턴 if(ch==EOF) break; // 파일내용의 끝이면 break; printf("%c",ch); //한자씩 출력 (current point 증가...) ..
#include <stdio.h> #include <stdlib.h> int main(void) { FILE *fp; fp=fopen("a.txt", "r"); //파일명과 사용할 권한 if(fp==NULL) { printf("파일이 없음"); system("pause\n"); exit(1); } printf("파일을 열었음"); system("pause"); ch=fgetc(fp); // OS가 생성한 버퍼의 주소를 리턴 printf("%c",ch); //한자씩 출력 (current point 증가...) ch..
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { FILE *fp; fp=fopen("a.txt", "r"); if(fp==NULL) { printf("파일이 없음"); system("pause\n"); exit(1); } printf("파일을 열었음"); system("pause"); return 0; } ------------------- 프로그램 위치에 파일이 있어야 함(a.txt)
#include <stdio.h> char *my_token(char *ps); int main(void) { char str[80]; char *p; printf("> 문장 입력 : "); gets(str); while((p = my_token(str)) != NULL) // 앞에서 부터 차례로 분리한 단어의 { printf("%s\n", p); // 포인터를 반환하여 출력한다. } return 0; } char *my_token(char *ps) { static char *addr; addr=ps; if(*addr==NULL) return NUL..
두개의 전역변수에 값을 입력하고 교환,출력하는 프로그램 입력 교환 출력 함수를 각각 생성 #include <stdio.h> void input_data(int *ap, int *bp); void swap_data(void); void print_data(int a, int b); int a, b; int main(void) { input_data(&a, &b); swap_data(); print_data(a, b); return 0; } void input_data(int *ap, int *bp) { printf("두 정..
10개, 20글자까지 제한된 단어를 입력하고 원하는 단어를 찾는 프로그램 #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char word[10][21],wd;//char word[10], wd; int i,j,cnt=0; for(i=0; i<10; ++i) { printf("단어 입력 (종료는 end 입력) : "); scanf("%s",&wd); if(strcmp("end",&wd)==0) break; else str..
- Total
- Today
- Yesterday
- 변수화
- powershell
- virt-sysprep
- dezoomify
- 중복제거
- sysprep
- dp-2
- vmware
- fromkeys
- 스토리지
- 부동없이
- artandculture
- powercli
- EXA
- Join
- 정렬
- 대소문자
- 3par
- vmware.powercli
- oracle
- 차집합
- dp-1
- insert
- storage
- set()
- LIST
- cloud-init
- 배열
- exadata
- 읽어오기
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |