I'm new to C++ and have a problem regarding Structured Data.



Look at the following structure declaration.

Write statements that..
A) Define a FullName structure variable named info
B) Assign your last, middle, and first name to the members of the info variable
C) Display the contents of the members of the info variable

1
2
3
4
5
6
  struct FullName
{
   string lastName;
   string middleName;
   string firstName;
};
Last edited on
What exactly is your problem?
So far you've declared a struct (which works as a data type). Now you need to declare a variable of that type and assign your first, middle and last name to its fields. Afterwards, show that information (probably using cout, unless you're told differently).
Topic archived. No new replies allowed.