scanf
fgets doesn't work after scanf [duplicate]
This question already has answers here: scanf() leaves the newline character in the buffer (7 answers) Closed 2 years ago.[详细]
2023-03-03 18:53 分类:问答Writing my first C program and I can't get past this dumb bug
I\'m using xCode because I found the debugger to be very useful. So in the debugger I see, after I enter the students name name[0] = \\0 no matter what. But then the rest of the name will be correct.[详细]
2023-03-01 17:47 分类:问答c fscanf error checking
I am using fscanf to read from a file in C. I was just wondering if I am correctly checking all the error conditions, and this is the most robust way to do so and I\'m not missing anything.[详细]
2023-03-01 01:12 分类:问答reading two consecutive integer and then its weight
I have a program which reads a integer from a file, as given below. value1 and value2 are to be taken from user.[详细]
2023-02-28 23:27 分类:问答How to read char as a number
This is really simply i know... unsigned char var = 11; ... fprintf(plik, \"%c\", var); Then I want to read:[详细]
2023-02-28 16:20 分类:问答How to detect a new line of any file using C program
I am reading a file of integers. I want to save integers from each line to a new array.开发者_StackOverflow For this I want to detect a new line of a file. If anybody knows this please help.[详细]
2023-02-28 15:24 分类:问答Strange output on using scanf
#include <cstdio> int main() { int i; printf(\"%d\", scanf(\"%d\", &i)); } Whatever number i input, i 开发者_Python百科get the output:[详细]
2023-02-28 05:43 分类:问答calling fscanf in assembly using nasm
I am trying to read 3 values from a file with a format as integer character whitespace integer. For example:[详细]
2023-02-28 05:05 分类:问答scanf formatting string for hex with dashes
I\'m trying 开发者_JAVA百科to write a C function to parse a MAC address input, with either spaces, colons or dashes as separators. I\'ve been looking into using %*[-:] to match multiple characters but[详细]
2023-02-25 12:05 分类:问答Parsing: library functions, FSM, explode() or lex/yacc?
When I have to parse text (e.g. config files or other rather simple/descriptive languages), there are several solutions that come to my mind:[详细]
2023-02-25 06:05 分类:问答