I´ve the following question:Code:#include <stdio.h> #define MAX=80 int main(void) { char puffer[MAX]; fgets(puffer,MAX-1,stdin); return 0; }
If you enter more than MAX-1 characters, what does happen with the characters after MAX-1 then?
I know that they will stay in stdin and be read in with the next call of e.g. fgets(), but what is, if the string´s length is too long for stdin?
I was taught that there cannot be any buffer-overflow, when you use fgets() in the example above, but how is this been prevent?
And can you then tell me how to find out the stdin-puffer´s size?
Thank you!
klausi