scanf
Lookahead in C/Reading
I wrote this code, as a sort of lookahead. int main() { char a[100]; char b[100]; scanf(\"%s\", a);开发者_开发百科[详细]
2023-04-06 14:02 分类:问答Stack smash and sscanf
reply is S|[2 3 4 5 6 7 8 9]|[2 3 4 5 6 7 8 9] char com[10], f[100], s[100]; sscanf(reply, \"%[^!]|%[^!]|%[^!]\", com, f, s);[详细]
2023-04-05 17:35 分类:问答fscanf matching one line, but not another, similar line
I\'m attempting to read a file (particularly /proc/stat) to get data out of it. There are a multitude of ways to do this in C, but (so far) I\'m using fscanf(). (However, I\'m not particularly tied to[详细]
2023-04-05 10:02 分类:问答Array changing first value without explicitly modifying it when calling fscanf
I am reading a value from std in and storing it in an array min[3] and later on proceed to make an array comparison. Somin is never touched before the comparison.[详细]
2023-04-05 09:02 分类:问答sscanf match double
sscanf(str, \"%lf\", &num); Here I try to parse a开发者_如何学JAVA double. It catches inf which is fine.[详细]
2023-04-04 17:09 分类:问答Printing a string backwards in C with scanf
I am trying to print my string backwards in c and I just can\'t seem to get it working with whitespaces. I am aware that if there is any whitespace after the last returned character in the scanf funct[详细]
2023-04-04 12:02 分类:问答Parsing strings of equations in c using scanf
I need to parse input from a user that could be any number of variations: 1+14(3-0) =x1*(3)-8 How do I do this using scanf to get the raw_input, then split out all of the different values and tell ei[详细]
2023-04-04 08:56 分类:问答Getting parts of a file path
I have a file path, gotten from the __FILE__ macro, and I want to extract 2 pieces from it. The format is: /some/path/to/a/file/AAA/xxx/BBB.cc. I want the AAA and BBB path. xxx is generally src, inc[详细]
2023-04-04 06:07 分类:问答Can you parse sentences with `scanf` and detect newlines?
开发者_运维问答Iknow how scanf could be used for parsing sentences into single words: while(1){[详细]
2023-04-04 02:33 分类:问答How to read an integer which appears right after new line in c?
int fscanf(FILE *stream, const char *format, ...); I can use fscanf() to read an integer from file. How can I read an integer that\'s right after a new开发者_Python百科line?fscanf() - look at the ex[详细]
2023-04-04 02:29 分类:问答