Turbo-C
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
터보-C 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
Lua 게시판
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C/C++ Q/A
[1707] 파일 입.출력 예제 중 하나 인데요 ~ 이상해요 ㅠ _ ㅠ`
김희섭 [tequila] 1394 읽음    2002-12-11 19:59
안냥하세욧~!!

휴휴 . . 공부 열심히 해볼라구 하는데 자꾸 막혀욧 ㅠ _ ㅠ . .

초보인 제가 봐도 정말 이상한 . . . 코든데요 . . ;;

에러가 무지무지 마니 나요  . . 컴파일러는 Dev C++ 4.9.6.0 이구요~

첫번째 : [Warning] In function `int main()':
두번째 : no match for `FILE & = FILE *'
세번째 : candidates are: struct _iobuf & _iobuf::operator =(const _iobuf &)
네번째 : cannot convert `fp' from type `FILE' to type `FILE *'
다섯째 : 위랑 똑같구용
여섯째 : 이것두 역시 똑같고...
일곱째 : 위랑 똑같아요.

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#define MAX 40

int main(void) {
  FILE fp;
  char words[MAX];
 
  if((fp = fopen("words", "a+")) == NULL) { 
    fprintf(stdin,"Can't open \"wordsk\" file.\n");
    exit(1);
  }
 
  puts("Enter words to add to the file; press the Enter");
  puts("key at the beginning of a line to terminate.");
 
  while(gets(words) != NULL && words[0] != '\0')
    fprintf(fp,"%s", words);
 
  puts("File contents:");
  rewind(fp);
 
  while(fscanf(fp,"%s", words) == 1)
    puts(words);
 
  if(fclose(fp) != 0)
    fprintf(stderr,"Error closing file\n");
  getch();
  return 0;
}

+ -

관련 글 리스트
1707 파일 입.출력 예제 중 하나 인데요 ~ 이상해요 ㅠ _ ㅠ` 김희섭 1394 2002/12/11
3759     Re:파일 입.출력 예제 중 하나 인데요 ~ 이상해요 ㅠ _ ㅠ` 최준호.스페로 1361 2002/12/11
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.