James
2012-05-06 21:17:19 UTC
How do I use the the struct within the vector? Specifically, I need input to be stored into text.
/************************************************************************/
Looks basically like this:
struct myStruct
{
string text;
.....(<- other parts of the struct that aren't important)
.....
};
int main()
{
string input;
vector
cin >> input;
myVector[0].text = input (<- this was my guess, but causes "error: segmentation fault (core dumped)" )
return 0;
}
/************************************************************************/
I have tried many other guesses at how to do this, but no dice. Help?