Share Pastebin
Guest
Public paste!

caiobm

By: a guest | Feb 28th, 2009 | Syntax: C | Size: 0.34 KB | Hits: 47 | Expires: Never
This paste has a previous version, view the difference. Copy text to clipboard
  1. #include <io.h>
  2. #include <fcntl.h>
  3.  
  4. main() {
  5.        int ind = creat("teste.txt", O_BINARY);
  6.        char* buf = "Olá, como esta\n\0";
  7.        int bufint[3];
  8.        
  9.        
  10.        write(ind, buf,18);
  11.        
  12.        bufint[0] = 1;
  13.        bufint[1] = 1111;
  14.        bufint[2] = 12;
  15.        
  16.        write(ind, bufint,3);
  17.        close(ind);
  18. }