Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- struct t2Node {
- char **txt;
- t2Node *prev;
- t2Node *next;
- };
- typedef t2Node *p2Node;
- void function(p2Node *left, p2Node *right);
- void init(p2Node *left, p2Node *right);
- int main() {
- p2Node left = NULL;
- p2Node right = NULL;
- ifstream fout("file.txt");
- string buf[50];
- if (fout.is_open()) {
- for (int i = 0; i < 2; ++i) {
- fout >> buf[i];
- }
- } else {
- cout << "File cannot be open";
- }
- cout << buf;
- return 0;
- }
- void function(p2Node *left, p2Node *right) {
- }
- /*
- void init(p2Node *left, p2Node *right) {
- p2Node cur;
- char buf;
- ifstream fout("file.txt");
- *left = *right = NULL;
- if (buf) {
- *left = new t2Node;
- (*left)->info = info;
- (*left)->prev = NULL;
- }
- cur = *left;
- cin >> info;
- while (info != 0) {
- cur->next = new t2Node;
- cur->next->prev = cur;
- cur = cur->next;
- cur->info = info;
- cout << "Enter the number (if you want to finish enter 0)";
- cin >> info;
- }
- cur->next = NULL;
- *right = cur;
- }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement