#include #include using namespace std; struct animal { char name[32]; char type[32]; char comment[128]; unsigned int age; float weight; }; struct animal read_animal(){ struct animal newanimal; printf("Enter the animal! \n"); printf("Name: "); cin >> newanimal.name; printf("Type: "); cin >> newanimal.type; printf("Comment (all one word!): "); cin >> newanimal.comment; printf("Age: "); cin >> newanimal.age; printf("Weight: "); cin >> newanimal.weight; return newanimal; } int main(){ struct animal a1; a1 = read_animal(); // Suppose we're working with a pointer struct animal* animal_pointer; // The arrow -> means that we've got a pointer, not an actual structure cout << animal_pointer->name << endl; // If you don't like arrows, you can type this instead: cout << (*animal_pointer).name << endl; return 0; }