This is my code. When I access dtr array in initImg function it gives a stack overflow exception. What might be the reason?
#define W 1000
#define H 1000
#de
You are trying to allocate memory from stack. the maximum memory which can be allocated using stack is complier dependent. So try something like this to avoid this kind of exception.
#include
#define W 1000
#define H 1000
#define MAX 100000
void initImg(int img[], float dtr[])
{
for(int i=0;i
You can use new as well instead of using malloc to allocate memory from heap...