קלט/פלט בקבצים

  • פתיחת קובץ לקריאה או כתיבה נעשית על ידי open.
  • קלט/פלט לקובץ נעשים על ידי שמוש ב-getc ו-putc.
  • סגירת קובץ על ידי close(dev).

דוגמא:

#include <conf.h>

#include <disk.h>

#include <file.h>

int xmain()

{

       int inputFile, outputFile;

       char ch;

       file1 = open(DOS, "C:\\folder\\input.txt", "r");

       file2 = open(DOS, "C:\\folder\\output.txt", "w");

       while ( (ch = getc(file1)) != EOF ) putc(file2, ch);

       close (file1);

       close (file2);

       return 0;

}

תגיות המסמך:

מאת: באסל

תודה

הסברתם את זה, כמו שאר הנושאים, באופן הכי ברור שיש.
שיתוף:
| עוד