About 59 results
Open links in new tab
  1. c - What does the scanf function return? - Stack Overflow

    10 From scanf: On success, the function returns the number of items successfully read. This count can match the expected number of readings or fewer, even zero, if a matching failure …

  2. c - Why does scanf require &? - Stack Overflow

    Oct 19, 2016 · I want to read a number from stdin. I don't understand why scanf requires the use of & before the name of my variable: int i; scanf("%d", &i); Why does scanf need the …

  3. How do I properly use scanf and what are its limits?

    Aug 3, 2025 · Thanks for asking. Here are some guidelines for using scanf within its limits. And here is a question abut alternatives to scanf.

  4. How to do scanf for single char in C - Stack Overflow

    Nov 24, 2012 · scanf(" %c", &c); The blank in the format string tells scanf to skip leading whitespace, and the first non-whitespace character will be read with the %c conversion specifier.

  5. c - Using the scanf () function - Stack Overflow

    Apr 4, 2013 · Using scanf and printf when you're confused about types is dangerous! scanf ("%s", &userinput); The type of &userinput is char (*)[256], but scanf expects %s to correspond to a …

  6. c - Parâmetros da função scanf - Stack Overflow em Português

    Jun 27, 2016 · A semântica do scanf consiste em processar as diretivas em sequência. Na diretiva de espaços, o scanf consome zero ou mais espaços, parando logo antes primeiro …

  7. The times when we have to use `scanf ("\n")` and `scanf ("%*c")`

    Mar 8, 2023 · 1 In C, when we use a scanf("%s") or scanf("%c") before a scanf("%s") or scanf("%[^\n]"), while giving in the input, there will be an extra '\n' at the end of the first input …

  8. Por que não precisa do `&` no `scanf ();`? - Stack Overflow em …

    Você está passando uma variável para a função não porque precisa mandar um valor para a função, de fato a variável pode nem ter um valor válido, para o scanf() isto não importa, a …

  9. How does scanf(" %[^\\n]", str); work in C Programming?

    Apr 15, 2017 · This scanf format string consists of two parts: a space character, which skips space characters (' ', '\t', '\n', etcetera) in the input, and the %[^\n] conversion specification, …

  10. c - Disadvantages of scanf - Stack Overflow

    Mar 12, 2010 · I want to know the disadvantages of scanf(). In many sites, I have read that using scanf might cause buffer overflows. What is the reason for this? Are there any other …