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

Nov 10, 2015 at 4:35pm


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 Nov 10, 2015 at 4:41pm
Nov 10, 2015 at 5:29pm
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.