I'm new with vectors. I'm trying to add objects to a vector. But the program can't compile because I have a problem in the code. But I don't know what is it. The error is:
error C2664: 'void std::vector<_Ty>::push_back(_Ty &&)' : cannot convert parameter 1 from 'Line (void)' to 'Line &&'
The code is:
Line help_line ();
cin >> ln_quan;
vector <Line> figure_line;
for (int i = 0 ; i < ln_quan ; i++)
{
figure_line.push_back(help_line);
}
The compiler says that the error is at the 6-th line (figure_line.push_back(help_line);).
I gave up trying to find a tutorial explaining how to add objects (I give up easily when doing such things...).
And what does 'Line (void)' and 'Line &&' mean? Is 'Line (void)' the class 'Line'? If so, what does '(void)' mean in this case?