general form of input an array using gets function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • osama2351
    New Member
    • Mar 2013
    • 1

    general form of input an array using gets function

    tell plz.
    because i am in trouble!
  • suvarna271
    New Member
    • Feb 2013
    • 19

    #2
    This http://megacplusplustutorials.blogsp...2/strings.html might help

    Comment

    • divideby0
      New Member
      • May 2012
      • 131

      #3
      gets is a horrible function as it doesn't check if input entered will fit in the buffer provided possibly corrupting your program or worse. Avoid it and any resource that suggests using it.

      Use fgets.

      Code:
      char buffer[BUFSIZ];
      fgets(buffer, sizeof buffer, stdin);

      Comment

      Working...