#include #include using namespace std; typedef struct { char name[32]; char age; } person_t; void set_age(person_t * const p, int age) { p->age = age; // this is OK //p++; // this is not allowed! } int get_age(const person_t * const p) { //p->age++; // this is not allowed! //p++; // this is not allowed! return p->age; // this is OK } int main() { person_t peter; strcpy(peter.name, "Peter Smith"); set_age(&peter, 25); std::cout << "Age of" << peter.name << " is " << get_age(&peter) << endl; }