first string: |S|t|r|i|n|g|\0|, it is declared in memory on the stack
Remove i, shift left: |S|t|r|n|g|\0| |<- empty "space" after the null terminator, the C string still holds the same amount of memory
Unaccessable unless you declare that slot explicitly. It's technically not a memory leak at this point since a.) you can access it and b.) the stack will get cleared after program/method execution.
edit: In hindsight the program will not overwrite bounds since it thinks that Strng\0 has the same space as String\0. Anyways...
edited for a better diagram
This post has been edited by KYA: 14 January 2009 - 02:09 PM