ok, that makes sense. thanks.
But just one last question...If I'm referencing a class that is elsewhere, why do I have to construct the class as if i'm making a new one?
also, there is now yet another problem that I can't explain...what a surprise
My compiler returns this and a whole bunch of alternatives that I can't even begin to decipher
main.cpp:472: error: no match for 'operator<<' in 'std::cout << ((weapon*)this)->weapon::namecentered(20)'
for this code
Code:
cout<< "+----------------------+----------------------+----------------------+----------------------+\n";
cout<< "| Please select your weapon of destruction |\n";
cout<< "+----------------------+----------------------+----------------------+----------------------+\n";
cout<< "| Option # | 1. | 2. | 3. |\n";
cout<< "| Weapon Name | " << weap1.namecentered(20) << " | " << weap2.namecentered(20) << " | " << weap3.namecentered(20) << " |\n";
cout<< "| Piercing Damage High | " << weap1.statfilled(20, 1)<< " | " << weap2.statfilled(20, 1)<< " | " << weap3.statfilled(20, 1)<< " |\n";
cout<< "| Piercing Damage Low | " << weap1.statfilled(20, 2)<< " | " << weap2.statfilled(20, 2)<< " | " << weap3.statfilled(20, 2)<< " |\n";
cout<< "| Blunt Damage Low | " << weap1.statfilled(20, 3)<< " | " << weap2.statfilled(20, 3)<< " | " << weap3.statfilled(20, 3)<< " |\n";
cout<< "| Blunt Damage Low | " << weap1.statfilled(20, 4)<< " | " << weap2.statfilled(20, 4)<< " | " << weap3.statfilled(20, 4)<< " |\n";
cout<< "| Fire Damage Low | " << weap1.statfilled(20, 5)<< " | " << weap2.statfilled(20, 5)<< " | " << weap3.statfilled(20, 5)<< " |\n";
cout<< "| Fire Damage High | " << weap1.statfilled(20, 6)<< " | " << weap2.statfilled(20, 6)<< " | " << weap3.statfilled(20, 6)<< " |\n";
cout<< "| Durability | " << weap1.statfilled(20, 7)<< " | " << weap2.statfilled(20, 7)<< " | " << weap3.statfilled(20, 7)<< " |\n";
cout<< "| Left in Clip | " << weap1.statfilled(20, 8)<< " | " << weap2.statfilled(20, 8)<< " | " << weap3.statfilled(20, 8)<< " |\n";
cout<< "| Clip Size | " << weap1.statfilled(20, 9)<< " | " << weap2.statfilled(20, 9)<< " | " << weap3.statfilled(20, 9)<< " |\n";
cout<< "| Store Ammo | " << weap1.statfilled(20, 10)<< " | " << weap2.statfilled(20, 10)<< " | " << weap3.statfilled(20, 10)<< " |\n";
cout<< "+----------------------+----------------------+----------------------+----------------------+\n\n";
it says that message for the first two that include my function, but it displays such a long list of alternatives that I think it may have just run out of room
These functions are both within the weapon class
Code:
void statfilled ( int gap, int stat )//displays the indicated stat to completely fill the gap indicated
Code:
void namecentered ( int gap )//displays the name of the weapon centered within the gap indicated