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're creating giant arrays on the stack. Just use std::vector instead:
std::vector
std::vector image(W*H); std::vector dtr(W*H);