Solved

get user input into the structure element

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

786 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