does input.getline(outorin, 8) grab 7 or 8 characters?

This is a discussion on does input.getline(outorin, 8) grab 7 or 8 characters? within the C++ Programming forums, part of the General Programming Boards category; does input.getline(outorin, 8) grab 7 or 8 characters? Eg, does it need an extra number so it can tack a ...

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    2

    does input.getline(outorin, 8) grab 7 or 8 characters?

    does input.getline(outorin, 8) grab 7 or 8 characters? Eg, does it need an extra number so it can tack a null on the end?

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    input.getline(outorin, 8) will read 7 characters from the input stream and then use the 8th to tag a nul on the end.

    Just a quick clarification on null and nul because there is a difference. Here's how I learned it:
    The one 'L' NUL ends an ASCII string.
    The two 'L' NULL points to no thing.
    The three 'L' NULLL means check your spelling.

    It's all very subtle, but NULL is all bits zero and NUL is '\0'

    -Prelude
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 10:39 PM
  2. HELP!!!!emergency Problem~expert please help
    By unknowppl in forum C++ Programming
    Replies: 9
    Last Post: 08-21-2008, 06:41 PM
  3. Replies: 10
    Last Post: 07-10-2008, 03:45 PM
  4. How do you check how many characters a user has entered?
    By engstudent363 in forum C Programming
    Replies: 5
    Last Post: 04-08-2008, 06:05 AM
  5. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM

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