About 94,500 results
Open links in new tab
  1. 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.

  2. c - Getting multiple values with scanf () - Stack Overflow

    Getting multiple values with scanf () Asked 16 years, 2 months ago Modified 4 years, 6 months ago Viewed 334k times

  3. Reading in double values with scanf in c - Stack Overflow

    69 I try to read-in 2 values using scanf () in C, but the values the system writes into memory are not equal to my entered values. Here is the code:

  4. io - How can I clear an input buffer in C? - Stack Overflow

    The C runtime library will take care of that for you: your program will see just '\n' for newlines. If you typed a character and pressed enter, then that input character would be read by line 1, …

  5. 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, …

  6. C: Multiple scanf's, when I enter in a value for one scanf it skips the ...

    Mar 5, 2012 · The scanf("%c") will immediately read this newline character, and the program will then go on to the next scanf("%d"), and wait for you to enter a number. The usual advice is to …

  7. c - Read a string as an input using scanf - Stack Overflow

    Jan 30, 2016 · char str[25]; And you cannot use scanf to read sentences--it stops reading at the first whitespace, so use fgets to read the sentence instead. And in your last printf, you need …

  8. C - scanf () vs gets () vs fgets () - Stack Overflow

    Jul 10, 2015 · Third, when using scanf() function, the result is completely wrong because first character apparently has a -52 ASCII value. For this, I have no explanation. Now I know that …

  9. c - multiple word string input through scanf ( ) - Stack Overflow

    Aug 24, 2010 · what was the syntax to input strings with more than one word i.e with space in between through scanf() not gets()

  10. c - When should I use ampersand with scanf () - Stack Overflow

    scanf("%d",a); printf("a[0]=%d\n",a[0]); if you enter 10 then prints a[0]=10. Usage of Pointers: if you use pointers as shown below, then you will come to know how to increment the pointer …