Solved

get user input into the structure element

Posted on 1998-11-01
2
149 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

756 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