Thread: new operator in for() loop

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Registered User
    Join Date
    Oct 2002
    Posts
    48
    this is it for constructor:

    book.cxx
    Code:
    #include "book.h"
    #include <iostream>
    #include <string>
    
    using namespace std;
    book::book( string title, string author, string publisher, 
                                    string month, string year, float price) {}
    all of the getFunctions() are declared in the .h file.

    The getInfo() function is not used, and has been removed, all input is read using
    getline(fstream,variable,delimiter);

    If I cout each variable as it is read in using getline, the output is correct... the problem is with the assignment:

    b1[size] = new book(title, author, publisher, month, year, price);
    Last edited by guda; 10-08-2004 at 10:46 PM.

Popular pages Recent additions subscribe to a feed