-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalien.cpp
More file actions
44 lines (37 loc) · 767 Bytes
/
alien.cpp
File metadata and controls
44 lines (37 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <fstream>
#include <cstddef>
using namespace std;
struct ll_lines {
string ll_data;
ll_lines *next;
};
int main(int argc, char const *argv[])
{
ll_lines *head;
ifstream inFile;
string line;
inFile.open("C:\\Users\\Zachary\\Documents\\Downloads\\scraps\\alien\\A-small-practice.in", ios::in);
head = new ll_lines;
if(inFile.is_open()){
while(getline (inFile, line)){
head->ll_data = line;
ll_lines *tmp = new ll_lines;
tmp->next = head;
head = tmp;
}
inFile.close();
}
ll_lines *next = head;
while(next != NULL){
cout << next->ll_data << endl;
ll_lines * tmp = next->next;
delete next;
next = tmp;
}
// cout << Stuff;
return 0;
}