I have this:
char * str = "hahahahahihihihihohohohohahahahahihihihihohohohohahahahahihihihihohohohohahahahahihihihihohohohohahahahahihihihihohohohohahahahahihihihihohohoho\0";
How do I format this correctly, breaking at 80 columns? Using:
char * str = "foo\
bar";
seems to be a very bad idea, it leads to undefined behavior, making strlen()
return nonsense values
edit: This is the undefined behavior I'm talking about:
#include <stdio.h>
#include <string.h>
int main(void)
{
char *s = "haha\
hihi\0";
unsigned i = strlen(s);
printf("Length: %i\n", i);
return 0;
}
imperator@RomaAeterna ~/P/C/undefined> gcc -Wall -Wextra undefined.c
imperator@RomaAeterna ~/P/C/undefined> ./a.out
Length: 14