cookiejar
asked on
SCANF - LIMIT THE NUMBER OF CHARARACTERS
NI WOULD LIKE TO LIMIT THE NUMBER OF CHARACTERS ENTERED INTO AN INPUT STRING.
I have defined studentName to contain only 15 characters.
How do I construct the format string to accept up to 15 characters only?
scanf("%[^\n]s", studentName);
I have defined studentName to contain only 15 characters.
How do I construct the format string to accept up to 15 characters only?
scanf("%[^\n]s", studentName);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.