Prasad wrote:
> On Oct 15, 9:39 pm, Ian Collins <ian-n...@hotmail.com> wrote:
>> Prasad wrote:
>>> Hi folks,
>>> I am trying to debug the following program. Debugging the core file
>>> revealed segfault at possibleFlows[i][k][m]=0 when values of
>>> states=36, labels=40. It works fine for lesser values.
>>> What could be the reason? Integer overflow or out of memory? Am i
>>> missing something obvious?
>>> I am using ubuntu and GNU g++.
>>> int main()
>>> {
>>> const int states=36, labels=40;
>>> int fromLabels=labels, toLabels=labels;
>>> int fromStates=states, toStates=states;
>>> int successors[fromStates][toStates];
>> This isn't legal C++, are you build this as C?
>>
Please don't quote signatures.
>
> This is a c++ program. I have removed all the namespace declaration,
> headers and other code which was not relevant to the problem.
No it is not, C++ does not have VLAs and successors is a VLA.
--
Ian Collins
|