Top "Scanf" questions

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

Using ifstream as fscanf

Assume that I have an input as follows: N (X_1,Y_1) (X_2,Y_2) .... (X_N, Y_N) where N, X_…

c++ c scanf ifstream
What is the need of hh and h format specifiers?

In the code below mac_str is char pointer and mac is a uint8_t array: sscanf(mac_str,"%x:%…

c scanf format-specifiers
Why scanf must take the address of operator

As the title says, I always wonder why scanf must take the address of operator (&).

c scanf addressof
fgets instructions gets skipped.Why?

Whenever I do a scanf before a fgets the fgets instruction gets skipped. I have come accross this issue in …

c scanf fgets
C - sscanf not working

I'm trying to extract a string and an integer out of a string using sscanf: #include<stdio.h> …

c scanf
error: unknown conversion type character 'l' in format - scanning long long

I'm trying to get long long from the console using standard IO function scanf. I started with %lld: scanf("%lld", &…

c scanf c99
What is stdin and how is it being used with fscanf?

I dont understand the connection between stdin and fscanf struct musteri{ int no; char name[40]; char surname[25]; double arrear; }; int …

c file stdin scanf randomaccessfile
Program doesn't execute gets() after scanf(), even using fflush(stdin)

After wasting too much time searching why my program doesn't execute gets() after using scanf(), I found a solution which …

c scanf gets fflush
sscanf doesn't move, scanning same integer everytime

I have a string that has ints and I'm trying to get all the ints into another array. When sscanf …

c string input scanf
sscanf equivalent in Java

Possible Duplicate: what is the Java equivalent of sscanf for parsing values from a string using a known pattern? I'm …

java string-parsing scanf