- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Hi out there. I can't get the constructors in my header files to work. Here's a copy of my header file code: [code] #ifndef GUARD_PHEADER_H #define GUARD_PHEADER_H //The header file for the Person.cpp. //person_header.h #include <iostream> #include <string> //Person class declaration class Person { public: std::istream& read_surname(std::istream&); std::istream& read_name(std::istream&); std::istream& … |
|
Hi I’m getting compile errors in the following code: [code] void Driver::read_data() { ifstream infile("data", ios::in); string name, surname; while (infile >> surname) { infile >> name; Person temp(infile); temp.read_surname(infile); temp.read_name(infile); temp.read_phone(infile); temp.read_age(infile); temp.read_weight(infile); 87 person_map[surname][name] = temp; } } [/code] The errors tell me that 87 driver.cpp instantiated from … |
|
Hi everyone. I’m having some problems:mad: debugging the following code: [code] typedef map<string, map<string, Person> > pclass; pclass::const_iterator i; map<string, Person>::const_iterator iter; pclass person_map; void Driver::add_record() { string surname, name, phone, age, weight; int new_age; double new_weight; cout << "Enter name: "; cin >> name; cout << "\nEnter surname: "; … |
|
Hi, I was wondering if anyone could help me. I'm constantly getting the following compiler message: 138 driver.cpp 'class pclass' has no member named 'surname' 138 driver.cpp 'class pclass' has no member named 'name' on the following lines: [code] 138 for (i = person[surname][name].begin(), i != person[surname][name].end(), ++i) { 139 … |