Thread: fscanf whole line

  1. #1
    Registered User
    Join Date
    Aug 2006

    fscanf whole line

    Is there a way to read the whole line from a .txt file, that contains spaces and write it to one string? Is there a function for it or do I have to try some longer code.

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Don't use fscanf(). Since you posted this in the C++ section, you're best off with getline() or something. Otherwise, if you're really using C, use fgets().

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. adding line numbers and concatenating a filename
    By durrty in forum C Programming
    Replies: 25
    Last Post: 06-28-2008, 03:36 AM
  2. Reading a buffer line by line, while using system read
    By Hammad Saleem in forum C Programming
    Replies: 9
    Last Post: 05-27-2008, 05:41 AM
  3. line number on a rich edit control
    By rakan in forum Windows Programming
    Replies: 1
    Last Post: 02-18-2008, 06:58 AM
  4. Adding Line numbers in Word
    By Mister C in forum A Brief History of
    Replies: 24
    Last Post: 06-24-2004, 08:45 PM
  5. Validating the contents of a char buffer
    By mattz in forum C Programming
    Replies: 3
    Last Post: 12-09-2001, 05:21 PM
Website Security Test