About 53 results
Open links in new tab
  1. gets () function in C - Stack Overflow

    Dec 3, 2010 · But gets() does not check the buffer space; in fact, it can't check the buffer space. If the caller provides a pointer to the stack, and more input than buffer space, gets() will happily overwrite …

  2. Why is the gets function so dangerous that it should not be used?

    The gets() function does not perform bounds checking, therefore this function is extremely vulnerable to buffer-overflow attacks. It cannot be used safely (unless the program runs in an environment which …

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

    Jul 10, 2015 · And the difference between gets/scanf and fgets is that gets(); and scanf(); only scan until the first space ' ' while fgets(); scans the whole input. (but be sure to clean the buffer afterwards so …

  4. Why is gets() not consuming a full line of input? - Stack Overflow

    Nov 20, 2022 · Since gets () or fgets () is getting skipped due to an already present '\n' from previous inputs in stdin, calling getchar () would lead to itself getting skipped instead of gets () or fgets () or …

  5. c++ - проблема с функцией gets () - Stack Overflow на русском

    Jan 2, 2018 · Это не тот код - по ссылке у вас fgets, а не gets! Вы случаем не Visual C++ 2015 или 2017 компилируете? Если заменить fgets на gets - да, эти компиляторы не компилируют - …

  6. What's the difference between gets and scanf? - Stack Overflow

    Oct 28, 2014 · gets - Reads characters from stdin and stores them as a string. scanf - Reads data from stdin and stores them according to the format specified int the scanf statement like %d, %f, %s, etc.

  7. c - puts (), gets (), getchar (), putchar () function simultaneously ...

    Feb 23, 2021 · I have a confusion related to using puts(), gets(), putchar() and getchar() simultaneously use in the code. When I have run the below code, it is doing all steps: taking the input, printing the …

  8. gcc - gets () problem in C - Stack Overflow

    Oct 21, 2012 · gets is dangerous because it lets you read in more data than you've allocated space for, you can use fgets which specifies how many characters it is going to read in and stops if it finds a …

  9. What is the difference between gets () and getc ()?

    Jan 4, 2015 · 1 gets() is no more a standard and it might lead to buffer overflow so you should use fgets() in-order to read till end of line . In order to read char by char until you encounter space you …

  10. c - Difference between fgets and gets - Stack Overflow

    Feb 9, 2015 · The problematic difference between gets and fgets is that gets removes the trailing '\n' from an input line but fgets keeps it. This means an 'empty' line returned by fgets will actually be the …