I have coded a chess game and it has the following part:
The dynamic memory allocation of the array, makes the program run slowly.
So I tried
but then it gives me a bug as there are no other moves which are tried. It seems that no other moves are loaded into the array execept for the first one.
Is there some problem due to memory allocation or the way in which I am accessing it?
here is the code from filter moves()
How can I allocate all the required memory statically?(There is tremendous slow-down due to dynamic memory allocation).