hi,
i using fgets() to get input from a user...
printf("Address [street no and name]: ");
fgets(cr->address_street, 40, stdin );
it works great - however, when it stores a string into my variable (cr->address_street) and also when i want to print the contents of the variable onto the screen - i find that my variable contains exactly 40 characters including a '\n' at the end, regardless of whether the user input string was 20 or 30 or x characters.
is there an easy way to get rid of the whitespace and newline after the data, which is automatically stored by fgets since i specified the length of string to read? please let me know if this is ambiguous...
thanks!