Solved

get user input into the structure element

Posted on 1998-11-01
2
150 Views
Last Modified: 2011-09-20
struct element abc [10][100]
char def[20]
how to get the user input into the structure element and test it.
0
Comment
Question by:wongmlai
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 0 total points
ID: 1176713
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
 
LVL 22

Expert Comment

by:nietod
ID: 1176714
What is happening with this question?  Did this help you?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Find boost header files using gnu make (MinGW) on Win 7 11 108
How to split this in C++ 4 127
Dialogbox API leak? 18 117
COM server issue 2 22
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question