The former embeds a null character followed by "FF", thus nothing was concatenated.

By the way, if this was supposed to be specifically C rather than the C part of C++, say the word and I shall move the thread. Otherwise, you should #include <cstdio> and <cstring> instead.

Originally Posted by Bjarne Stroustrup (2000-10-14)

I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.

0xFF is an int. "\0xFF" is a string. If you want to use a character constant, then it should be '\xFF'.

Originally Posted by meili100

2) Why strchr does not need to escape 0 ?

It is not about strchr, but the fact that the literal is an int literal.

Originally Posted by Bjarne Stroustrup (2000-10-14)

I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.