Advertisement
diegoaguilar

progb

Mar 2nd, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <fcntl.h>
  5. #include <sys/types.h>
  6. #include <sys/stat.h>
  7. #include <unistd.h>
  8. #include <string.h>
  9.  
  10. int main(){
  11.     int fd1;
  12.     int i;
  13.     fd1=open("numeros",O_WRONLY);
  14.     for(i=0;i<100;i++){
  15.         if(i%2!=0){
  16.             write(fd1,&i,sizeof(i));
  17.         }
  18.     }
  19.     printf("se han mandado 50 numeros impares a la fifo\n");
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement