I have faced this problem : Run-Time Check Failure #2 - Stack around the variable 's' was corrupted in visual studio 12 . I also try this in codeblock but faced same problem . I run my code also in ideone.com it shows runtime error . Help me out ? my code is :I have faced this problem : Run-Time Check Fail