forked from AlejandroSherman/CS100Lab7Factory
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.cpp
More file actions
39 lines (28 loc) · 650 Bytes
/
Copy pathmain.cpp
File metadata and controls
39 lines (28 loc) · 650 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
#include <iostream>
using namespace std;
#include <vector>
#include <list>
#include "Div.hpp"
#include "Pow.hpp"
#include "Sub.hpp"
#include "add.hpp"
#include "base.hpp"
#include "mult.hpp"
#include "op.hpp"
#include "rand.hpp"
#include "factory.hpp"
int main (int argv, char** argc){
Factory* f = new Factory();
Base* output = f->parse(argc, argv);
if (output == nullptr){
cout << "got nullptr!" << endl;
}
// for(int i = 1; i < argv; i++) {
// cout << argc[i] << endl;
// }
else{
cout << "My string is: " << output->stringify() << endl;
cout << "My number is: " << output->evaluate() << endl;
}
return 0;
}