`I am trying to limit the amount of characters that a user can enter for the address(/ in the input buffer):
for example (if maximum allowed input was 30 then ):
->4 Mary drive lane, Mt. Pyle, A<- when the user typed that I am trying to get the curser -> "_" to stop moving...
I have searched and have not come up with anything but I may have used different keywords than what was needed.
1. I am thinking that this has to do with stdin
2. I have tried getch put example: getch(50) put aparently getch takes no arguments...
3. Thank you in advance
4.If you don't understand my problem then I will try to explain it further
(I started to use fgets when I saw someone here explain to someone)
printf ("\n\t\t Enter Address:");
//scanf ("%34s",pat_Ptr->address);
if ( fgets ( pat_Ptr->address, 50, stdin ) != NULL ) {
fputs ( pat_Ptr->address, stdin ); /*this writes the input the user enters to a string*/
}
(pat_Ptr->address)[strcspn ( (pat_Ptr->address), "\n" )] = '\0';
printf ("\n Address is:%s\n",records.address);