#include <iostream>using namespace std;class terran { private: char * m_unitname; int m_health; public: terran(); terran(char * unitname, int health); void show(); };int main() { terran obj1("hey", 10); obj1.show(); return 0; }void terran::show() { cout << m_unitname; cout << m_health; }terran::terran(char *unitname, int health){ m_health = health; m_unitname = unitname;}
I needed the last function. I needed to, again, assign the private thing to a number/name.