but i dnt understand why only in debuggn mode its works fine but not in normal mode....
Your debugger checks your heap for you. A heap is memory assigned to your
process from which your program allocates dynamic memory. Memory that
belongs to the heap but isn't allocated by your program should not be accessed
by your program. Have a look again at that debugger warning:
-
warning:Heap block at 00032550 modified at 00032559 past requested size of 1
It is trying to tell you that your program has allocated a small block of memory
(size 1) at address00032550 but it is trying to access memory at address
00032559 and that memory doesn't belong to your program.
If your program is running standalone, i.e. without a debugger, it makes the same
mistake but there's noone around to protect your program so it'll strangle and
kill itself in a most miserable way.
kind regards,
Jos