I was writing a piece of code where I use sizeof("somestring") as a parameter of a function, then I noticed the function was not returning the expected value, so I went to see the corresponding asm code and I found an unpleasant surprise. Does anyone have an explanation for this (see the picture)?

I know there are 1000+ different ways of doing this, I already implemented another one of them, but I do want to know the reason behind this behaviour.
For the curious, this is Visual Studio 2008 SP1.
String literals are of type “array of n
const char” ([lex.string], ¶8), where n is the number ofchars of which the string is composed. Since the string is null-terminated,sizeofwill return the number of “normal” characters plus 1; the watch window is wrong, it’s probably a bug (as @Gene Bushuyev said, it’s probably interpreting it as a pointer instead of as a literal=array).The fact that the value 5 is embedded into the code is normal, being
sizeofa compile-time operator.