Jan 23, 2015 at 5:07pm UTC
The error message is pretty clear. You're not initialising the value of i .
What do you think the result of i < values.size()
will be, if you haven't given i a value?
What do you think the result of ++i
will be, if you haven't given i a value?
Jan 23, 2015 at 5:56pm UTC
The value returned by deque::size() is of type size_t , which is unsigned.
You've defined i as int , which is signed.
Jan 28, 2015 at 5:39pm UTC
I found the error where i done silly mistake where i wish to declare deque < int > values instead of deque <double> values.
1 2 3 4 5
using namespace std;
void main(void ) {
deque <int > values
ostream_iterator<int > output(cout, " " );
p/s: my code is working.
Last edited on Jan 28, 2015 at 5:40pm UTC