Top "Scanf" questions

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

How do I read white space using scanf in c?

Problem: I need to be able identify when two whitespaces occur consecutively. I have read the following questions: how to …

c whitespace scanf fgets
Reading character with scanf()

This code is for game of craps. #include <stdio.h> #include <stdlib.h> #include <stdbool.…

c char scanf specifier
Input in C. Scanf before gets. Problem

I'm pretty new to C, and I have a problem with inputing data to the program. My code: #include <…

c input scanf gets
Is sscanf considered safe to use?

I have vague memories of suggestions that sscanf was bad. I know it won't overflow buffers if I use the …

c security buffer-overflow scanf
string format for intptr_t and uintptr_t

What is the string format for intptr_t and uintptr_t which is valid for both the 32 and 64 bit architecture . …

c formatting printf scanf
How to use int16_t or int32_t with functions like scanf

The way that I understand int16_t or int32_t in C is that they are typedefed to be 16 and 32 …

c user-input scanf
Using "\n" in scanf() in C

I mistakenly used scanf("%d\n",&val); in one of my programmes, I could not understand the behavior, the …

c scanf
getchar_unlocked( ) VS scanf() VS cin

What is the difference among these three input functions in programming language. Do they input in different ways from each …

c++ scanf
Using fscanf() using feof()

Here's my code. #include<stdio.h> void main(){ FILE *fp; int a,b; fp=fopen("hello.txt","r"); …

c scanf feof
Use scanf with Regular Expressions

I've been trying to use regular expressions on scanf, in order to read a string of maximum n characters and …

c unix scanf expression formatted-input