File Input Stream constructor

This is a discussion on File Input Stream constructor within the C++ Programming forums, part of the General Programming Boards category; I need help with creating a constructor. I'm reading in a file with this data Person Kristina Chung 1366 11 ...

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    4

    File Input Stream constructor

    I need help with creating a constructor.

    I'm reading in a file with this data

    Person Kristina Chung 1366 11 20


    Person::Person( ifstream &in){

    in >> this->type;
    in >> this->firstName;
    in >> this->lastName;
    in >> this->birthDay.year; //not sure???

    }

    I have a date class, and a variable birthDay in the person class. How do I set the year/month/day ?

    added instruction

    Nevermind, I figured it out.
    Last edited by yes2; 12-16-2010 at 01:12 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. IDE for C embedded advanced editing
    By Undici77 in forum Tech Board
    Replies: 32
    Last Post: 01-16-2010, 05:17 PM
  2. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 05:27 PM
  3. fscanf in different functions for the same file
    By bchan90 in forum C Programming
    Replies: 5
    Last Post: 12-03-2008, 09:31 PM
  4. simulate Grep command in Unix using C
    By laxmi in forum C Programming
    Replies: 6
    Last Post: 05-10-2002, 05:10 PM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM

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