Consider the statement printf("hello");
This statement sends the string literal "hello"
to the printf();
function.
Lets now separately consider the code
char* a = "hello";
This would point to an address where the string literal "hello"
is stored.
What if one does
char* a = "hello" + 1;
It will make a
point to an address where "ello"
is stored. Address of "hello" + 1
, which points to address of the string literal "ello"
Apply this to your code
printf("hello"+!f);
f
has value 1
. !f
will have value 0
. So, eventually it will point to the address of the string literal "hello" + 0
, which is "hello"
. That is then passed to the printf()
.
You are not getting an error because it is not an error.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…