I am having trouble accepting input from a text file. My program is supposed to read in a string specified by the user and the length of that string is determined at runtime
Try
scanf("%4s", str)