no need to read furthr i figured out my problem but thanks for taking a look
thanksCode:#include <iostream> #include <string.h> using namespace std; class skid{ private://stats are private int defense;//intilizes variable defense int strength;//intilizes strength int health; string location; int level; public: int attack(){//for use when he "attacks" skid skid; skid.strength; cout<< "You are attacking!"; } int getdefense() //retrieves defense value from the private part of class { cout<< "Defense: " << defense << "\n"; } int getstrength()//retrieves strength { cout<< "Strength: " << strength << "\n"; } int gethealth() { cout<<"Health: " << health << "\n"; } void getlocation() { cout<<"Location: " << location << "\n"; } int getlevel() { cout<<"You are currently level " << level; } void getall() //displays all { getdefense(); getstrength(); gethealth(); getlocation(); getlevel(); cin.get(); } int setvalues() { defense = 1; strength = 1; health = 1; location = "home"; level = 1; } }; int main(){ skid b; b.setvalues(); b.getall(); }
cj



LinkBack URL
About LinkBacks


