I'm trying to send data (fishname) from the class "Fish" to the primary class "Animal". I made an object, and tried to access the subclass function to send the data from the subclass to the primary class.

My goal: Send whatever I write in the readFish() to Animal 's private name char.

Code:

```
#include <iostream>
using namespace std;

const int STRLEN = 32;

class Animal {
private:
    char name[STRLEN];

public:
    Animal() { }                                     
    Animal(char animalname) { name[STRLEN] = animalname; }  
};

class AnimalInWater : public Animal {
private:

public:
    AnimalInWater() { }

};

class Fish : public AnimalInWater {
private:
    char fishname[STRLEN];   

public:
    void readFish() {
        cout << "The name of the fish: "; cin.getline(fishname, STRLEN);
        Animal(fishname);       // Is supposed to use the constructor seen in Animal class
    }

};

int main() {

    Animal a1;          
    d1.readFish();      // readFish() is in the Fish class, which is under AnimalInWater which is under Animal.
                        // In other words; the readFish() function is the granddaughter class of Animal.

    return 0;
}

```