scanf
Why fscanf not working as expected for subsequent calls?
char s[20]; fscanf(stream, \"%s\", s); I found that it can only work for the first time, subsequent calls will fail.[详细]
2023-04-04 01:05 分类:问答fscanf() to take input
Here\'s my code: FILE* fp,*check; fp=fopen(\"file.txt\",\"r\"); check=fp; char polyStr[10]; while(fgetc(check)!=\'\\n\')[详细]
2023-04-03 17:14 分类:问答Confused with the char array when scanf
I am confused with one tiny program. #include <stdio.h> #define LEN 10 int main() { char str1[LEN] = \"\\0\";[详细]
2023-04-01 05:08 分类:问答fscanf returns (null)
When running the following code: FILE *input; char *name=NULL,*stat=NULL; int i=0,j=0; input=fopen(\"/proc/1/stat\",\"r\");[详细]
2023-03-31 08:54 分类:问答Why does a space in my scanf statement make a difference? [duplicate]
This question already has answers here: What does space in scanf mean? [duplicate] (6 answers) Closed 7 years ago.[详细]
2023-03-30 09:08 分类:问答php sscanf problem
I have this string: City Lat/Lon: (50.7708) / (6.1053) and I try to extract those two numbers with sscanf in php this way:[详细]
2023-03-28 10:58 分类:问答scanf problem in input
hi I am having problems using scanf when reading two strings with spaces consecutively char name[50] = {0};[详细]
2023-03-28 03:19 分类:问答C scanf() and fgets() problem
I\'m trying to read user input and store it as a string including the whitespace.I did a search for a solution and was pointed to fgets() or scanf(%[^\\n], str).But both these solutions give me an err[详细]
2023-03-27 21:31 分类:问答Format specifiers for uint8_t, uint16_t, ...?
If I have an integer variable I can use sscanf as shown below by using the format specifier %d. sscanf (line, \"Value of integer: %d\\n\", &my_integer);[详细]
2023-03-26 17:00 分类:问答scanf on non-STDIN input
Is it possible to run scanf on input that it is not STDIN? What I mean is if I have a string=\"hello 1 2 3\", can I run scanf on it to extract the str开发者_StackOverflow中文版ing and three integers?[详细]
2023-03-25 17:16 分类:问答