Solved

get user input into the structure element

Posted on 1998-11-01
2
145 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
Comment Utility
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
Comment Utility
What is happening with this question?  Did this help you?
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now