Thread: Assigning

  1. #1



    How do I take a whole sentence from a datafile and store it as one varialbe? I tired using quotes ..but it does not work . tHanks!

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    IN.getline(array, 256, '\n');
    That will read in one line of data from the file, assuming that IN is a file pointer and the sentence is no greater than 256 characters. The read will stop at either a newline or when it's read a maximum of 256.

    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Assigning Ability Scores
    By SteelySam in forum C++ Programming
    Replies: 1
    Last Post: 07-10-2008, 02:16 PM
  2. Replies: 5
    Last Post: 06-10-2007, 05:54 AM
  3. silence warning when assigning pointers
    By eth0 in forum C Programming
    Replies: 5
    Last Post: 10-27-2005, 11:18 AM
  4. Confusion with assigning values to structs.
    By Tronic in forum C++ Programming
    Replies: 9
    Last Post: 03-22-2004, 08:01 AM
  5. Assigning the value of a const array to a normal array
    By Accident Prone in forum C++ Programming
    Replies: 6
    Last Post: 08-11-2003, 10:40 PM