Hello :)
Is there any way to do this?
(Green is working code, Red is non-working code)
Thanks :cool:Code:int main()
{
struct INT_STR{
int i;
string s;
};
INT_STR a;
INT_STR b;
a.i = 123;
b.s = "abc";
//Everything above works
//Things get buggy below
vector<INT_STR> c; //I also tried vector<struct>, but thought it was strange since it would not refer to a specific structure this way
c.push_back(a.i); //adds 123 to vector c
c.push_back(b.s); //adds "abc" to vector c
cout << c.at(0) << "," << c.at(1);
//On the console, we'd see
//123,abc
}