• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 157
  • Last Modified:

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.
  • 2
1 Solution
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.
What is happening with this question?  Did this help you?
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.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now