Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. 198397652
  2. 2014-11-14 15:10:10
  3. Buy
  4. 0.00517290
  5. 0.00100000
  6. 0.00100000
  7. 0.00000517
  8. 198397652
  9. 2014-11-14 15:10:10
  10. Buy
  11. 0.00517290
  12. 0.00100000
  13. 0.00100000
  14. 0.00000517
  15.  
  16. 198397652
  17. 2014-11-14 15:10:10
  18. Buy
  19. 0.00517290
  20. 0.00100000
  21. 0.00100000
  22. 0.00000517
  23. 198397652
  24. 2014-11-14 15:10:10
  25. Buy
  26. 0.00517290
  27. 0.00100000
  28. 0.00100000
  29. 0.00000517
  30. 198397652
  31. 2014-11-14 15:10:10
  32. Buy
  33. 0.00517290
  34. 0.00100000
  35. 0.00100000
  36. 0.00000517
  37. 198397652
  38. 2014-11-14 15:10:10
  39. Buy
  40. 0.00517290
  41. 0.00100000
  42. 0.00100000
  43. 0.00000517
  44.  
  45. #include <iostream>
  46. #include <vector>
  47. #include <string>
  48. #include <cstring>
  49.  
  50.  
  51. std::vector<std::string> getmybuyData()
  52. {
  53. FILE *fp = stdio;
  54. if (fp == NULL) perror ("Error opening file");
  55. char buydbuff[BUFSIZ];
  56. bool more = true;
  57. do{
  58. std::vector<std::string> v;
  59. for (int i=0; (i < 7) && (more = (fgets(buydbuff, BUFSIZ, fp) != NULL)); ++i){
  60. size_t n = strlen(buydbuff);
  61. if (n && buydbuff[n - 1] == 'n') buydbuff[n - 1] = '';
  62. v.push_back(buydbuff);
  63. //return v;
  64. }
  65. for(int p = 0; p < v.size(); ++p){
  66. std::cout << v[p] << std::endl;
  67. }
  68. return v;
  69. } while (more);
  70. }
  71.  
  72. std::vector<std::string> markData(){
  73. std::vector<std::string> vd;
  74. vd = getmybuyData();
  75. for (int j=0; j < vd.size(); ++j)
  76. {
  77. std::cout << vd[j] << std::endl; //main goal is to print data here.
  78. }
  79.  
  80. return vd;
  81. }
  82. int main()
  83. {
  84. markData();
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement