Share good ideas and conversation. Login or Take a Tour!
Devac · 852 days ago · link · · parent · post: Ph.D. students face significant mental health challenges
Not even the stuff written after two spaces of indentation is displayed verbatim. Which is unfortunate. It's actually supposed to be C++. There are no escape characters in C.
–
Oh, now you're just being reasonable about a language that allows you to commit some proper code-atrocities: #include <stdlib.h> { char * str = (char*)malloc(1); free((void*)(str[10] = '\0')); str[1] = 'a'; printf("%s", str); free((void*)str); return 0; } This compiles and doesn't cause segfault. Believe me, I get what you are saying. EDIT: Changed the allocated amount of space, not that it mattered to the compiler… #include <stdio.h>
int main(void)