get user input into the structure element

struct element abc [10][100]
char def[20]
how to get the user input into the structure element and test it.
wongmlaiAsked:
Who is Participating?
 
nietodConnect With a Mentor Commented:
How you get the input will depend on what is in the structure.  For example

struct element
{
   int AnInt;
  char AChar;
};

//note no struct need here.
element abc[10][100];


cout << "Please enter an integer > "
cin >> abc[0][0].AnInt;
cout << "Please enter a character > "
cin >> abc[0][0].AChar;

let me know if you have questions.
0
 
nietodCommented:
What is happening with this question?  Did this help you?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.