1. Why sometimes any piece of code works fine in th debug version and fails in the release version ?
could anyone please state the difference between relase and debug version?
Debug code contains all the information that the symbolic debugger requires to locate the symbols in memory. Also it is normal to switch off the optimiser when producing a debug build otherwise it can be very hard to follow the code through the debugger. The debug build is often many times bigger than the release build.
As has been mentioned time issues can occur in debug builds because of the increase code size but there can be other effects too. An old version of the Microsoft compiler used to initialise automatic variables to 0 in the debug build. This meant that if you forgot to initialise a variable you could create a working debug build and a non-working release build.
2. int *ptr[10]; //10 pointers pointing to an integer
what happens if we do ptr++ ?What should I do if I want to acess all the pointers?
int(*ptr)[10]; //pointer pointing to an array of integers
what happenes if we do ptr++ here ?Can I do it?
In your first case
the code is not compilable because ptr is not an l-value because in fact ptr is not a pointer, it is an array. Because of this the ++ operator is not valid for it.
In the second case
as stated already ptr++ increments the address pointed to by sizeof(*ptr). I would recomend you google for pointer arithmetic, there are many pages explaining it.