Guest User

Untitled

a guest
Dec 16th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. int main(void){
  6. FILE *arq;
  7. double aux[3];
  8. arq = fopen("teste.txt", "r+b");
  9. if(arq == NULL){
  10. cout << "Erro";
  11. exit(1);
  12. }
  13. fread(aux, sizeof(double), 3, arq);
  14. for(int i=0; i<3; i++){
  15. cout << "Numero lido: " << aux[i] << "\n";
  16. }
  17. fclose(arq);
  18. }
Add Comment
Please, Sign In to add comment