#include <iostream>
usingnamespace std;
class Human{
char *name;
int age;
float height;
float weight;
public:
Human (char *N, int A, float H, float W);
void Prints () const;
void Set (char *N, int A, float H, float W);
};
int main(){
Human myObj;
myObj.Prints();
myObj.Set("Ronaldo", 28, 185.0, 85.0);
myObj.Prints();
}
I never get it run on Dev C++. but my friend report it. that it work in Xcode.
The constructor and other functions need to be defined so that the values sent in actually get assigned to the data members. Right now there are just prototypes.