+ 1
is this code valid?
#include <stdio.h> int main() { printf(6+"hello\0world"); return 0; }
3 odpowiedzi
+ 6
This is valid code.
And it skip first 6 characters in a string. So it prints only "world".
+ 6
Not very common the use of '\0' in the middle of a string, but it's ok in term that it runs. Valid is a contextual word.
+ 4
Your code may be valid but if you use that number less than 6 then you will get a warning as you used \0 in the middle of the sentence.