Every C++ program must define an entry point in the form of a main
function .
Edit the file main.cpp in the src directory and replace the text that is there with the following:
#include <iostream>
#include "node.hpp"
#include "tree.hpp"
using namespace strom;
const double Node::_smallest_edge_length = 1.0e-12;
int main(int argc, const char * argv[]) {
std::cout << "Starting..." << std::endl;
Tree tree;
std::cout << "\nFinished!" << std::endl;
return 0;
}
Recall that the data member _smallest_edge_length
in the class Node
was declared to be static, so we must initialize it in a source code file, and main.cpp
is our only source code file, hence the line that sets _smallest_edge_length
to the very tiny value 1.0e-12
.
The main
function firsts announces that the program is starting to run (by displaying Starting...
to standard output), then creates a Tree
object having nodes made of Node
objects, then announces that the program is finished running just before returning 0 (the exit code 0 tells the operating system that the program ended normally).