Hi got some questions

This is a discussion on Hi got some questions within the C++ Programming forums, part of the General Programming Boards category; Hi, I have some questions, is getline function only used with arrays? Can we use getline function for the classes ...

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    96

    Hi got some questions

    Hi,

    I have some questions, is getline function only used with arrays?

    Can we use getline function for the classes without arrays?

  2. #2
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,556
    What?
    getline is a function used to read a line from a stream into a string.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    2,717
    There are two versions of getline() one that works with C-strings and one that works with std::string. You need to use the proper version depending on what type of "string" you are using.

    Jim

  4. #4
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,556
    The other version should not be used unless you can state a very good exception.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. questions....so many questions about random numbers....
    By face_master in forum C++ Programming
    Replies: 2
    Last Post: 07-30-2009, 08:47 AM
  2. Gui questions
    By h3ro in forum Windows Programming
    Replies: 2
    Last Post: 08-05-2008, 02:11 AM
  3. c++ questions
    By jmarsh56 in forum C++ Programming
    Replies: 3
    Last Post: 05-03-2006, 06:15 AM
  4. Some questions about DSO's...
    By LinuxCoder in forum Linux Programming
    Replies: 2
    Last Post: 04-11-2006, 09:47 AM
  5. questions
    By kuwait in forum C++ Programming
    Replies: 4
    Last Post: 11-19-2002, 12:35 PM

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