ok...i'm new to this c language and i was wondering what am i supposed to do if the user enters a string that is longer than my array size. for our assignment, we're supposed to ask for the user's name and our array size is supposed to be 20 characters. if the user enter something more than 20, we're supposed to give an error message saying that only the first 20 characters will be stored. for my code, if the user enters more than 20 characters, the additional character would be assigned to another variable. what am i supposed to do.
i'm using fscanf to accept the string but i read that it's better to use gets.