Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. #include <vector>
  5. using namespace std;
  6. struct sample
  7.     {
  8.             long time;
  9.             double angle;
  10.     }
  11. void get_gesture( vector<sample> gestures, FILE* file)
  12. {
  13.     long sample_time;
  14.     double sample_angle;   
  15.     file.open("/home/ensta2009/Desktop/gauss/doi.txt");
  16.     while (!f1.eof() && !f1.fail())
  17.     {  
  18.             if ( f1.fail() ) break;        
  19.             f1 >> sample_time;
  20.             gestures.time.push_back(sample_time);          
  21.             f1 >> sample_angle;
  22.             gestures.angle.push_back(sample_angle);
  23.     }
  24. }          
  25.  
  26.  
  27. }
  28. int main()
  29. {
  30.    
  31.     vestor<sample> gestures[10];   
  32.     ifstream file; 
  33.     file.open("/home/ensta2009/Desktop/gauss/doi.txt");
  34.     get_gesture(gestures, file);
  35.     file.close();
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement