About 2,800,000 results
Open links in new tab
  1. How do I read a string entered by the user in C? - Stack Overflow

    You should never use gets (or scanf with an unbounded string size) since that opens you up to buffer overflows. Use the fgets with a stdin handle since it allows you to limit the data that will be placed in …

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

    Jan 18, 2017 · A C-string is a sequence of bytes terminated by null character. Therefore we can always know the end of the string. Even if we point at a memory location which does not represent a starting …

  3. How to read string from keyboard using C? - Stack Overflow

    I want to read a string entered by the user. I don't know the length of the string. As there are no strings in C I declared a pointer: char * word; and used scanf to read input from the keyboard: ...

  4. How do I deal with string input in C? - Stack Overflow

    Aug 24, 2016 · Also, operators in C like ==, !=, +=, + are defined for build-in data types in C and since, there is no operator overloading in C, you can't use these operators with your C-String as C-Strings …

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

  6. How do I properly compare strings in C? - Stack Overflow

    The problem is that I keep getting the printing of the input string, even when the input by the user (check) matches the original (input). Am I comparing the two incorrectly?

  7. How to read / parse input in C? The FAQ - Stack Overflow

    Feb 3, 2016 · 24 I have problems with my C program when I try to read / parse input. Help? This is a FAQ entry. StackOverflow has many questions related to reading input in C, with answers usually …

  8. 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 …

  9. How to input strings into an array in C? - Stack Overflow

    Jan 7, 2017 · I tried to get the inputs (strings) from user and store them in an array.But after I ran this code, the program instantly crashed. #include <stdio.h> int main () { int i; char *word [3]...

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

    Jan 30, 2016 · Read a string as an input using scanf Asked 9 years, 11 months ago Modified 6 years, 1 month ago Viewed 114k times