scanf
How to read blank lines using %[^\n]s?
I am having a program where fscanf(fp,\"%[^\\n]s\",line); is used for reading a line. If I put in a while loop,[详细]
2023-04-13 07:24 分类:问答When to use printf/scanf vs cout/cin?
I\'m testing some snippets I found off the web using g++ from MinGW.This is the C++ compiler...why then does it correctly compile C....why do p开发者_StackOverflow中文版eople intertwine C and C++.[详细]
2023-04-13 01:23 分类:问答How can one read a file from MATLAB?
I have a text file that contains 113 line and 10 columns. Every line has the following format: user110137210.000.001.000.000.000.000.00[详细]
2023-04-12 23:53 分类:问答How to read string from keyboard using C?
I want to read a string entered by the user. I don\'t know the length of the string. As there are no strings in C I declared a pointer:[详细]
2023-04-11 17:20 分类:问答C separate a string into 4 variables
I\'d want to separate a string into 4 parts. What I need is basically this: sscanf(string, \"%d %d %d %[^\\n]\", id1, id2, id3, restOfString);[详细]
2023-04-11 14:09 分类:问答How can I separate a string in 3 shorts and the rest in one string (this string as white spaces in it) in C?
How can I separate a string that has white spaces between the 3 shorts and between the rest of the string to 4 different stri开发者_如何学Pythonngs.[详细]
2023-04-11 10:20 分类:问答fscanf bus error: 10 when switching from Snow Leopard to Lion
First off, this snippet is not meant for production code. So please, no lec开发者_JAVA技巧turing about it \"being unsafe.\" Thanks![详细]
2023-04-11 08:17 分类:问答scanf() skip variable
In C, using scanf() with the parameters, scanf(\"%d %*d\", &a, &b) acts differently. It enters value for just one variable not two![详细]
2023-04-10 05:11 分类:问答C: how to store integers by reading line by line with a random layout?
I ne开发者_开发问答ed to read a file and store each number (int) in a variable, when it sees \\n or a \"-\" (the minus sign means that it should store the numbers from 1 to 5 (1-5)) it needs to store[详细]
2023-04-10 04:14 分类:问答How to scan a file of data and print a value to the screen when a number first exceeds a set number
I\'m working in C and I\'m very new at it (2 weeks ago). Basically I have a file that has two columns of data separated by a space. I need to read from the file, line by line, and determine when the f[详细]
2023-04-07 14:07 分类:问答