Assigning

This is a discussion on Assigning within the C++ Programming forums, part of the General Programming Boards category; Hi! How do I take a whole sentence from a datafile and store it as one varialbe? I tired using ...

  1. #1
    Unregistered
    Guest

    Assigning

    Hi!

    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
    Posts
    9,796
    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.

    -Prelude
    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, 03:16 PM
  2. Replies: 5
    Last Post: 06-10-2007, 06:54 AM
  3. silence warning when assigning pointers
    By eth0 in forum C Programming
    Replies: 5
    Last Post: 10-27-2005, 12:18 PM
  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, 11:40 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21