Click here to Skip to main content
12,896,517 members (67,882 online)

C / C++ / MFC

 
GeneralRe: How to make a project resolution independent.? Pin
mbatra3119-Dec-12 1:25
membermbatra3119-Dec-12 1:25 
GeneralRe: How to make a project resolution independent.? Pin
Jochen Arndt19-Dec-12 1:33
memberJochen Arndt19-Dec-12 1:33 
GeneralRe: How to make a project resolution independent.? Pin
mbatra3119-Dec-12 1:44
membermbatra3119-Dec-12 1:44 
GeneralRe: How to make a project resolution independent.? Pin
Jochen Arndt19-Dec-12 2:06
memberJochen Arndt19-Dec-12 2:06 
AnswerRe: How to make a project resolution independent.? Pin
Alan Balkany19-Dec-12 4:25
memberAlan Balkany19-Dec-12 4:25 
QuestionASM with stams library of C ++ Pin
Gurunathkudalkar18-Dec-12 21:15
memberGurunathkudalkar18-Dec-12 21:15 
AnswerRe: ASM with stams library of C ++ Pin
CPallini18-Dec-12 22:19
mvpCPallini18-Dec-12 22:19 
Questionerror C2228 "must have class/struct/union" Pin
alaaan7318-Dec-12 4:55
memberalaaan7318-Dec-12 4:55 
in Flight.h i have this prototype :
bool reserveSeat(Passenger psngr, bool smoker); 

and i have to do the implementation for it , i try to do it but i got an error :
"
error message :
task b\flight.cpp(15): error C2228: left of '.setPassportNumber' must have class/struct/union
1>type is ''unknown-type''
1> b\flight.cpp(16): error C2065: 'passenger' : undeclared identifier
1>b\flight.cpp(16): error C2228: left of '.setContactNumber' must have class/struct/union
1>type is ''unknown-type''
1> b\flight.cpp(17): error C2228: left of '.smokerSeat' must have class/struct/union

and here is my try
bool Flight::reserveSeat(Passenger psngr, bool smoker)
{
   Passenger.setPassengerName(psngr.getPassengerName());
   passenger.setPassportNumber(psngr.getPassportNumber());
   passenger.setContactNumber(psngr.getContactNumber());
   reservations.smokerSeat=smoker;
 
}


note that Flight have an object of Reservation and here's the Reservation constuctor :
Reservation.cpp
Reservation::Reservation(Passenger& psngr, bool smoke)
	
{
   passenger.setPassengerName(psngr.getPassengerName());
   passenger.setPassportNumber(psngr.getPassportNumber());
   passenger.setContactNumber(psngr.getContactNumber());
   smokerSeat=smoke;
}//end consreuctor 
 


and here's the whole Flight Header
 
#include "reservation.h"
#include "okReservation.h"
#include "waitReservation.h"
class Flight{
	
private:
	int waitingListMax;
	int seats;
	int seatsCount;
	Reservation** reservations;
	
public:
	Flight(int capacity, int waitingMax);
	bool reserveSeat(Passenger psngr, bool smoker);
	
	//Searches for the reservation with the given reservation number, and 	//deletes it. Uses the confirmReservation function if the reservation to be 	//deleted was an OK one 
	void cancelReservation(string resNum);
	
	//Deletes the given waiting reservation after creating a new OK reservation 	//for the same passenger. Returns a pointer to the newly created reservation
	okReservation confirmReservation(waitReservation* res); 
	void printWaitingList();
	void printReservationList();
 
	};

AnswerRe: error C2228 "must have class/struct/union" Pin
Chris Losinger18-Dec-12 5:19
memberChris Losinger18-Dec-12 5:19 
AnswerRe: error C2228 "must have class/struct/union" Pin
Richard MacCutchan18-Dec-12 7:09
mvpRichard MacCutchan18-Dec-12 7:09 
AnswerRe: error C2228 "must have class/struct/union" Pin
Stefan_Lang21-Dec-12 1:59
memberStefan_Lang21-Dec-12 1:59 
QuestionCan we capture HD video using DirectShow C++/MFC .? Pin
mbatra3117-Dec-12 23:30
membermbatra3117-Dec-12 23:30 
QuestionCWinApp::OnFileNew failed ? Pin
Codzer17-Dec-12 19:23
memberCodzer17-Dec-12 19:23 
GeneralRe: CWinApp::OnFileNew failed ? Pin
Jochen Arndt17-Dec-12 21:33
memberJochen Arndt17-Dec-12 21:33 
GeneralRe: CWinApp::OnFileNew failed ? Pin
Codzer18-Dec-12 2:48
memberCodzer18-Dec-12 2:48 
AnswerRe: CWinApp::OnFileNew failed ? Pin
Jochen Arndt18-Dec-12 3:03
memberJochen Arndt18-Dec-12 3:03 
QuestionLinked List Via Disk File Pin
imboared117-Dec-12 19:01
memberimboared117-Dec-12 19:01 
SuggestionRe: Linked List Via Disk File Pin
Richard MacCutchan17-Dec-12 22:15
mvpRichard MacCutchan17-Dec-12 22:15 
QuestionConfused with destructor Pin
Super Lloyd17-Dec-12 2:33
memberSuper Lloyd17-Dec-12 2:33 
AnswerRe: Confused with destructor Pin
Erudite_Eric17-Dec-12 4:54
memberErudite_Eric17-Dec-12 4:54 
GeneralRe: Confused with destructor Pin
Super Lloyd17-Dec-12 5:01
memberSuper Lloyd17-Dec-12 5:01 
GeneralRe: Confused with destructor Pin
jschell17-Dec-12 8:31
memberjschell17-Dec-12 8:31 
GeneralRe: Confused with destructor Pin
Super Lloyd17-Dec-12 16:59
memberSuper Lloyd17-Dec-12 16:59 
GeneralRe: Confused with destructor Pin
megaadam18-Dec-12 3:51
membermegaadam18-Dec-12 3:51 
GeneralRe: Confused with destructor Pin
Stefan_Lang19-Dec-12 5:33
memberStefan_Lang19-Dec-12 5:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 29 Apr 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid