About 1,450,000 results
Open links in new tab
  1. Which is the best way to get input from user in C?

    Feb 14, 2012 · The scanf is the standard method to get formatted input in C, and fgets / fgetc is the recommended standard function to get whole lines or single characters. Most other functions are …

  2. Get text from user input using C - Stack Overflow

    Feb 27, 2014 · I am just learning C and making a basic "hello, NAME" program. I have got it working to read the user's input but it is output as numbers and not what they enter? What am I doing wrong? …

  3. What is the simplest way of getting user input in C?

    There seem to be a LOT of ways you can get user input in C. What is the easiest way that requires little code? Basically I need to display this: Enter a file name: apple.text Basically I need t...

  4. How do I get input for an array from a user in C programming?

    Apr 29, 2020 · Except in the case the syntax of C would have changed recently, this is not true. For allocating an array without knowing the size when you enter into a function, you have to allocate it …

  5. How do I read a string entered by the user in C? - Stack Overflow

    I want to read the name entered by my user using C programmes. For this I wrote: char name [20]; printf ("Enter name: "); gets (name); But using gets is not good, so what is a better way?

  6. How can I get an int from stdio in C? - Stack Overflow

    scanf("%d", &input_value); In most cases, however, you want to check whether your attempt at reading input succeeded. scanf returns the number of items it successfully converted, so you typically want to …

  7. How to read a line from the console in C? - Stack Overflow

    What is the simplest way to read a full line in a C console program The text entered might have a variable length and we can't make any assumption about its content.

  8. Requesting user input in C - Stack Overflow

    Sep 24, 2018 · 1 I'm new to C programming and i find prompting for user input quite a challenge for beginners like me. I'm just writing a simple C code to continuously prompt for user input until the user …

  9. C getting input from CMD - Stack Overflow

    Apr 12, 2015 · 0 How do you get input using prompt? I tried compiling the code bellow into "a.exe" and executing it from CMD like "gcc a.exe 5", but it doesn't output the number like it was supposed to.

  10. c - Reading string from input with space character? - Stack Overflow

    Jan 18, 2017 · Then with the %*c it reads the newline character from the input buffer (which is not read), and the * indicates that this read in input is discarded (assignment suppression), as you do not need …