The core code of a simulation I am writing goes like:
for(int it = 0; it < Nt; it++)
{
//cout << it << endl;
variables = var_function(variables, it);
}
This code gives me SIGSEGV when run. To find out in which time it
does the forbidden memory access happen I print on the screen with the line cout << it << endl;
. The weird behavior is that when that line is un-commented, the SIGSEGV error disappears. What is going on?