c++/10407: non-numeric assignment to for initialzation cause seg fault
bangerth@dealii.org
bangerth@dealii.org
Mon Apr 14 21:56:00 GMT 2003
Synopsis: non-numeric assignment to for initialzation cause seg fault
State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Mon Apr 14 21:56:17 2003
State-Changed-Why:
Not a bug. You are accessing the element one past the end:
for(int i = v.size(); i >= 0 ; i--)
cout << i + 1 << ": " << v[i] << endl;
Start with i=v.size()-1 !
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10407
More information about the Gcc-bugs
mailing list