1 / 1

#include < stdio.h > int main(void) { FILE * fp ; int x,y ; fp = fopen (" test.txt","r &quot

파일에 쓰기. 파일에 서 읽 기. #include &lt; stdio.h &gt; int main(void) { FILE * fp ; int x=44,y=55; fp = fopen (&quot; test.txt&quot;,&quot;w &quot;); if( fp == (FILE *)NULL) { fprintf ( stderr ,&quot;file open fail !!!<br>&quot;); exit(1); } fprintf ( fp ,&quot;%d %d&quot;, x,y ); fclose ( fp ); }.

mili
Download Presentation

#include &lt; stdio.h &gt; int main(void) { FILE * fp ; int x,y ; fp = fopen (&quot; test.txt&quot;,&quot;r &quot

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 파일에 쓰기 파일에서읽기 #include <stdio.h> int main(void) { FILE *fp; int x=44,y=55; fp = fopen("test.txt","w"); if(fp == (FILE *)NULL) { fprintf(stderr,"file open fail !!!\n"); exit(1); } fprintf(fp,"%d %d",x,y); fclose(fp); } #include <stdio.h> int main(void) { FILE *fp; intx,y; fp = fopen("test.txt","r"); if(fp == (FILE *)NULL) { fprintf(stderr,"file open fail !!!\n"); exit(1); } fscanf(fp,"%d %d",&x,&y); printf("x = %d y = %d \n",x,y); fclose(fp); }

More Related