Search:

Type: Posts; User: forseti42

Search: Search took 0.00 seconds.

  1. Replies
    22
    Views
    2,815

    Nope, I also left them out of the make. ...

    Nope, I also left them out of the make.

    Program runs fine now.

    I'm finished!

    Thanks everyone for the help!
    Ryan
  2. Replies
    22
    Views
    2,815

    Nope, I forgot to include them. Now I have the...

    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()'...
  3. Replies
    22
    Views
    2,815

    Ok, I'm nearly finished. I'm trying to create...

    Ok, I'm nearly finished. I'm trying to create the forest using the array of tree pointers.


    //-------------------------------------------------------------------------
    //Default Forest...
  4. Replies
    22
    Views
    2,815

    The error is due to the semi-colon after...

    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.
  5. Replies
    22
    Views
    2,815

    Ok, everything is going well, but I'm having...

    Ok, everything is going well, but I'm having trouble with my destructor for my forest class:



    //-------------------------------------------------------------------------
    //Default Forest...
  6. Replies
    22
    Views
    2,815

    Ok, everything is going well, but I'm having...

    Ok, everything is going well, but I'm having trouble with my destructor for my forest class:



    //-------------------------------------------------------------------------
    //Default Forest...
  7. Replies
    22
    Views
    2,815

    This is an intro c++ course and they explicitly...

    This is an intro c++ course and they explicitly tell us to use "using namespace std".
  8. Replies
    22
    Views
    2,815

    I created the tree pointer like so: tree...

    I created the tree pointer like so:


    tree *treePtr;

    treePtr=&a;

    (*treePtr).showSymbol(cout);

    b.showSymbol(cout);
  9. Replies
    22
    Views
    2,815

    Ok, I needed to call the original tree...

    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...
  10. Replies
    22
    Views
    2,815

    Thank you laserlight! That definitely helps. ...

    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...
  11. Replies
    22
    Views
    2,815

    Ok, according to the instructions, I have to...

    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...
  12. Replies
    22
    Views
    2,815

    Polymorphism Help

    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
    ...
  13. Thread: Class Help

    by forseti42
    Replies
    11
    Views
    1,905

    Found my error. The problem lies in the function...

    Found my error. The problem lies in the function regrowth.
  14. Thread: Class Help

    by forseti42
    Replies
    11
    Views
    1,905

    Ok, it compiles, but it doesn't run anymore. ...

    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){

    ...
  15. Thread: Class Help

    by forseti42
    Replies
    11
    Views
    1,905

    Hah, there I go again making stupid simple...

    Hah, there I go again making stupid simple mistakes.

    I forgot to put forest in front.
  16. Thread: Class Help

    by forseti42
    Replies
    11
    Views
    1,905

    Here is the header file for the forest class: ...

    Here is the header file for the forest class:


    #ifndef FOREST_H
    #define FOREST_H

    //Forest class declaration

    #include"tree.h"
    #include<iostream>
  17. Thread: Class Help

    by forseti42
    Replies
    11
    Views
    1,905

    Class Help

    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...
Results 1 to 17 of 17