Top "Scanf" questions

Questions related to the scanf() family of functions in the C runtime library, which read and convert formatted data.

Read no more than size of string with scanf()

Edit: for my class I have to use scanf. So recommending other ways of input is not the solution I …

c string scanf format-specifiers
Looking for C# equivalent of scanf

I used to code in C language in the past and I found the scanf function very useful. Unfortunately, there …

c# scanf
read char from console

I write console application which performs several scanf for int And after it ,I performs getchar : int x,y; char …

c scanf getchar
How do I parse out the fields in a comma separated string using sscanf while supporting empty fields?

I have a comma separated string which might contain empty fields. For example: 1,2,,4 Using a basic sscanf(string,"%[^,],%[^,],%[^,],%[^,],%[^,]", &val1, &…

c string csv parsing scanf
Simple C scanf does not work?

If I try something such as: int anint; char achar; printf("\nEnter any integer:"); scanf("%d", &anint); printf("\nEnter …

c console scanf
Using scanf in a while loop

Probably an extremely simple answer to this extremely simple question: I'm reading "C Primer Plus" by Pratta and he keeps …

c while-loop equality scanf
Program doesn't wait for user input with scanf("%c",&yn);

This is the basic code to a program I am writing to practise using files in C. I am trying …

c scanf file-pointer
Difference between fgets and fscanf?

I have a question concerning fgets and fscanf in C. What exactly is the difference between these two? For example: …

c fgets scanf
C/C++ printf() before scanf() issue

I'm using Eclipse to code in C/C++ and I'm struggling with what might be something pretty easy. In my …

c printf output scanf
String input using C scanf_s

I've been trying to look for answer myself, but I can't find one. I want to insert a part of …

c string scanf c11 tr24731