Skip to content
Advertisement

Segmentation fault core dumped 2d array

I’m trying to compile a c code under linux using gcc-4.9 (tried also 5.4) while so, I faced a segmentation fault error.

JavaScript

this is the part of code where the problem exists:

JavaScript

automorf is an array n x n long (int automorf[n][n])

Can you please help correcting the problem?

Advertisement

Answer

Try this and see output output

we have not p3[3]; and trying to access make error or undefined behavior.

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement