Unexpected Error

Revision en3, by arasmus, 2016-07-17 21:50:02

19194587
The code gives runtime error .
the line mod1[X%10].push_back({X/10,f,s}) is causing the problem , if u comment it out everything runs fine
How can this simple push_back() cause a RE (array index of mod1 vector are in bound)

  for(int s=0;s<=6;s++)
for(int f = 0; (f+s)<=6;f++){
int X = s*7 + f*4;
mod1[X%10].push_back({X/10,f,s});
}

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English arasmus 2016-07-17 21:50:02 383 Tiny change: '10,f,s}) is ' -/code
en2 English arasmus 2016-07-17 21:31:34 278 Tiny change: 'is? \n 'is? \nUPDATE : \n
en1 English arasmus 2016-07-17 21:02:42 142 Initial revision (published)