Nope, I also left them out of the make.
Program runs fine now.
I'm finished!
Thanks everyone for the help!
Ryan
Type: Posts; User: forseti42
Nope, I also left them out of the make.
Program runs fine now.
I'm finished!
Thanks everyone for the help!
Ryan
Nope, I forgot to include them.
Now I have the following error:
/home/ryan/Desktop/C++_Lab/Final_Project/Part K/forest.cpp:32: undefined reference to `pine::pine()'...
Ok, I'm nearly finished. I'm trying to create the forest using the array of tree pointers.
//-------------------------------------------------------------------------
//Default Forest...
The error is due to the semi-colon after forest(). It is declared in the header file, but adding the semi-colon is redeclaring it in the implementation.
Ok, everything is going well, but I'm having trouble with my destructor for my forest class:
//-------------------------------------------------------------------------
//Default Forest...
Ok, everything is going well, but I'm having trouble with my destructor for my forest class:
//-------------------------------------------------------------------------
//Default Forest...
This is an intro c++ course and they explicitly tell us to use "using namespace std".
I created the tree pointer like so:
tree *treePtr;
treePtr=&a;
(*treePtr).showSymbol(cout);
b.showSymbol(cout);
Ok, I needed to call the original tree constructor with parameters. It works now.
I should have reworded my last statement. Right now I'm only working on the Inheritance part, but when apply...
Thank you laserlight! That definitely helps.
That would take care of the default constructor for the classes, but how would I go about adding a constructor with parameters in the oak and pine...
Ok, according to the instructions, I have to create a base class pointer named treePtr that points to a tree object. Then that in turn will assign the address of each object to treePtr and call...
I have a base class tree. Using this class, I have to create two derived classes, oak and pine.
Here is the base class tree:
#ifndef TREE_H
#define TREE_H
//Tree class declaration
...
Found my error. The problem lies in the function regrowth.
Ok, it compiles, but it doesn't run anymore. Comment out the call to regrowth and the program runs fine.
Here is the whole code for the driver loop:
while(b.isBurning()==true){
...
Hah, there I go again making stupid simple mistakes.
I forgot to put forest in front.
Here is the header file for the forest class:
#ifndef FOREST_H
#define FOREST_H
//Forest class declaration
#include"tree.h"
#include<iostream>
I'm currently working on my forest class for my forest fire simulation, but I've run into trouble.
In one particular spot, it wants to say grid is not declared.
Here is a working implementation...