This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
csce420pine64backup/hw2/hw2pr1/hw2pr1.cpp
Alex Huddleston ea50b0cb6a Transferring.
2017-10-25 07:34:40 -05:00

68 lines
1.3 KiB
C++

// Name: Alexander Huddleston UIN: 223000555
// CSCE 420
// Due: 11:59 P.M. Monday, October 30, 2017
// hw2pr1.cpp
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <math.h>
#include "node.h"
using namespace std;
node makeTree(string input, node n, int level)
{
char tempc = input[0];
input = input.substr(1);
if(tempc == '(')
{
}
while(input.length() != 0)
{
if(tempc)
{
}
}
}
int main(int argc, char **argv)
{
// Initialization of input string.
string input = "";
// For testing, I want to read from a file.
// Typing in an tree from the keyboard each execution is a waste of time.
if(argc > 1)
{
if(!((string)argv[1]).substr(0, 2).compare("-f"))
{
ifstream file;
string line;
try
{
file.open("hw2pr1_data.txt");
}
catch(exception e)
{
cerr << "File not found, or could not be opened." << endl;
}
while(!file.eof())
{
getline(file, line);
input += line;
}
}
}
else
{
cout << "Please input a tree: ";
cin >> input;
}
cout << input << endl;
return 0;
}