07.06.2013 Views

Baca Tulis File

Baca Tulis File

Baca Tulis File

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Baca</strong> <strong>Tulis</strong> <strong>File</strong><br />

Melakukan pembacaan atau penulisan data<br />

- menggunakan operand fread() atau fwrite()<br />

Sintaks: fwrite (char * buffer, size t, count n, iobuf *);<br />

#include <br />

#include <br />

#include <br />

Contoh program menulis #include <br />

data ke file:<br />

void main() {<br />

// Mendeklarasikan stream untuk proses input<br />

FILE *Var<strong>Tulis</strong>;<br />

char Teks[80];<br />

// membuka file<br />

Var<strong>Tulis</strong> = fopen("COBA.TXT", "w");<br />

if(Var<strong>Tulis</strong>==NULL){<br />

cout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!