char buffer[80];
fgets(buffer,sizeof buffer,stdin);
How can i make the buffer size the exact size of the input that will be entered in so if i enter lets say "hello" and the buffer will hold H,E,L,L,O,<garbage>, instead of having garbage right after hello and then the null terminator at 79? how can i make it so that the buffer just holds H,E,L,L,O,\n instead? or the exact size of any word entered in? so i can compare strings in the future