strmid has a bug
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
You are not including the space required for the null terminator, which results in stack overflow. The arrays "ABC" and "DEF" should each be 4 cells wide to hold a string of length 3 + null terminator.

On another note, don't write variable names in all caps. By convention, all caps is reserved for constants (#define and const).
I know all that, i just threw this together and put it inside main() to see whether it was interfered by whatever I'm doing. Yeah, forgot about the null char, but the array size doesn't matter, the result remains the same.... (just tested)
Reply


Messages In This Thread
strmid has a bug [Solved] - by liquor - 16.07.2015, 17:26
Re: strmid has a bug - by Vince - 16.07.2015, 17:29
Re: strmid has a bug - by liquor - 16.07.2015, 17:33
Re: strmid has a bug - by liquor - 16.07.2015, 17:42

Forum Jump:


Users browsing this thread: 1 Guest(s)