tugas

kalender

January 2016
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

File and streams

Posted in: Uncategorized by firmandr on January 6, 2016

 

File definition

Definisi
Collection of record
Record is a collection of field
Terdiri tadi blok byte
Byte = kumpulan bit
Text file = teks format / ascii file
Ascii = american standart

Binary File
Lebih kompleks dan ga bisa diedit

Buffer area

FILE *fp;
Openfile > suka keluar
FILE *fopen

R = read
W = write
A = append = tambahin data

R+ = buka file
W+ = buat baru

Rb= read binary
Wb = write binary

Close file

Int fclose(FILE*stream);
Fclose() define at<stdio.h>
Fclose = menutup agar aplikasi lain bisa berjalan
EOF= end of file = return -1

Int fclose all = menutup semua

~fgetc(stdin)
Random ambil 1karakter

Fputc(‘a’, stdout)
Tulis 1 karakter

Input file
Fscanf()
Input data

Fprintf()
Output file
Print with format

~Fwrite
Menulis 1 blok data
Equals to(gets)

Fread
Ngambil data sesuai ketentuan karakter

Feof
File end of file
Reurn 0 bila data belum habis
Return 1 kalau data habis

Stream
Urutan dari suatu karakter

Tags: