-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
43 lines (36 loc) · 889 Bytes
/
main.cpp
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
/**
* Course: CS014 Summer 2020
*
* First Name: Shawn
* Last Name: Long
* Username: slong024
* email address: [email protected]
*
*
* Assignment: e.g. assn5
* Filename : e.g. main.cpp
*
* I hereby certify that the contents of this file represent
* my own original individual work. Nowhere herein is there
* code from any outside resources such as another individual,
* a website, or publishings unless specifically designated as
* permissible by the instructor or TA.
*/
#include "Graph.H"
int main(int argc, char* argv[]) {
if(argc != 2) {
cerr << "Usage error: expected <executable> <input>" << endl;
exit(1);
}
ifstream ifs(argv[1]);
if(!ifs) {
cerr << "Input file not found." << endl;
exit(1);
}
Graph g(ifs);
ifs.close();
g.bfs();
g.output_graph();
cout << "The End." << endl;
return 0;
}