|
안냥하세욧~!!
휴휴 . . 공부 열심히 해볼라구 하는데 자꾸 막혀욧 ㅠ _ ㅠ . .
초보인 제가 봐도 정말 이상한 . . . 코든데요 . . ;;
에러가 무지무지 마니 나요 . . 컴파일러는 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;
}
|