My code uses gets_s() to get a string input from the user.If the user enters a string whose length is greater than the specified in gets_s, the application aborts.So how to handle that gracefully?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you can invoke _set_invalid_parameter_handler at the beginning of your program to set a callback function to handle the error, in the callback function, you should check the value of errno.