this is the code:
#include <stdio.h>
#include <unistd.h>
void main(){
char str1[18]= "moo\0 cuek\n";
printf("lel: %s",str1);
write(STDOUT_FILENO,str1,18);
write(STDOUT_FILENO,"meow ",19);
}
and the output is:
moo cuek
meow moo cuek
lel:moo
also, why is meow
printed first and then moo cuek
(second line)
P.S. when I put \n
inside printf like:
printf("lel: %s \n",str1);
I get:
lel:moo
moo cuek
meow moo cuek
Why?!