Q: Why is an error reported when-s is not prompted in scanf or fgets of gdb?
Source: Internet
Author: User
Q: Why is an error reported when-s is not prompted in scanf or fgets of gdb? -- Linux general technology-Linux technology and application information. For details, refer to the following section. [I = s] This post was last edited by segment
The code in the program is as follows:
..................
Printf ("Enter a string, or leave blank when done :");
Fgets (input, 79, stdin );
Input [strlen (input)-1] = 0;
..................
Execute gdb as follows:
(Gdb) s
Getinput () at test5.c: 36
36 printf ("Enter a string, or leave blank when done :");
(Gdb) s
_ Printf (format = 0x80486e4 "Enter a string, or leave blank when done :")
At printf. c: 34
34 printf. c: the file or directory does not exist.
In printf. c
What is going on? Is the program wrong, or is there a problem with the use of GDB?
The running result is correct.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service