Advertisement
Guest User

Indiv2

a guest
Dec 9th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. struct t2Node {
  6. char **txt;
  7. t2Node *prev;
  8. t2Node *next;
  9. };
  10. typedef t2Node *p2Node;
  11.  
  12. void function(p2Node *left, p2Node *right);
  13. void init(p2Node *left, p2Node *right);
  14.  
  15. int main() {
  16. p2Node left = NULL;
  17. p2Node right = NULL;
  18.  
  19.  
  20. ifstream fout("file.txt");
  21. string buf[50];
  22. if (fout.is_open()) {
  23. for (int i = 0; i < 2; ++i) {
  24. fout >> buf[i];
  25. }
  26. } else {
  27. cout << "File cannot be open";
  28. }
  29. cout << buf;
  30.  
  31. return 0;
  32. }
  33.  
  34. void function(p2Node *left, p2Node *right) {
  35.  
  36. }
  37. /*
  38. void init(p2Node *left, p2Node *right) {
  39. p2Node cur;
  40. char buf;
  41. ifstream fout("file.txt");
  42.  
  43. *left = *right = NULL;
  44. if (buf) {
  45. *left = new t2Node;
  46. (*left)->info = info;
  47. (*left)->prev = NULL;
  48. }
  49. cur = *left;
  50. cin >> info;
  51. while (info != 0) {
  52. cur->next = new t2Node;
  53. cur->next->prev = cur;
  54. cur = cur->next;
  55. cur->info = info;
  56. cout << "Enter the number (if you want to finish enter 0)";
  57. cin >> info;
  58. }
  59. cur->next = NULL;
  60. *right = cur;
  61. }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement