I am getting \"Bus Error\" trying to read stdin into a char* variable. I just want to read whole stuff coming over stdin and put it fi
stdin
char*
Since you don't care about the actual content, why bother building a string? I'd also use getchar():
getchar()
int c; size_t s = 0; while ((c = getchar()) != EOF) { s++; } printf("Size: %z\n", s);
This code will correctly handle cases where your file has '\0' characters in it.
'\0'