yeh sure :)
some "destructors" and "friends"...
will work that trough.
still two questions left:
first: how do i loop trough a struct?
and second: what am i doing wrong here? i want to define my sexlife as a seperate class. this doesnt make sense here, but it does make sense in complicated 3d engines etc...
some "destructors" and "friends"...
will work that trough.
still two questions left:
first: how do i loop trough a struct?
and second: what am i doing wrong here? i want to define my sexlife as a seperate class. this doesnt make sense here, but it does make sense in complicated 3d engines etc...
#include "stdafx.h" #include <iostream> using namespace std; struct adress { public: int age; sexlife sexlife; }; struct sexlife { public: int times_doing_it; int have_some_fun() { times_doing_it++; } }; int main() { adress martin; martin.age = 16; martin.sexlife.times_doing_it = 2; cout << "Age: " << martin.age << "\n"; cin.get(); }