this is what i got so far and it gives me a weird result... something like -11348679835
also on another topic: i needa know how you can define an object of a class of the type of another class.
#include "stdafx.h" #include <iostream> using namespace std; struct adress { public: int age; }; int main() { adress martin; adress joe; martin.age = 16; joe.age = 10; // cout << "Age (martin): " << martin.age << "\n"; // cout << "Age (joe): " << joe.age << "\n"; adress* classarray = new adress[1]; adress x; for (int i = 0; i < 2; i++) { x = classarray[i]; cout << x.age << "\n"; } delete classarray; cin.get(); }
also on another topic: i needa know how you can define an object of a class of the type of another class.