Click here to Skip to main content
14,211,651 members

ATL / WTL / STL

 
GeneralRe: how to determine max TCP/IP send size Pin
bkelly1318-Dec-15 15:39
memberbkelly1318-Dec-15 15:39 
GeneralRe: how to determine max TCP/IP send size Pin
Richard MacCutchan18-Dec-15 21:47
protectorRichard MacCutchan18-Dec-15 21:47 
AnswerRe: how to determine max TCP/IP send size Pin
Albert Holguin17-Feb-16 9:41
professionalAlbert Holguin17-Feb-16 9:41 
QuestionCFolderPickerDialog can't be inherited Pin
Prasanth.outofboxt6-Dec-15 22:59
memberPrasanth.outofboxt6-Dec-15 22:59 
SuggestionRe: CFolderPickerDialog can't be inherited Pin
Jochen Arndt7-Dec-15 1:00
mveJochen Arndt7-Dec-15 1:00 
QuestionBuilding Graphical Menu Choices Pin
Tino Debelo16-Nov-15 14:07
memberTino Debelo16-Nov-15 14:07 
QuestionRe: Building Graphical Menu Choices Pin
Richard MacCutchan16-Nov-15 20:57
protectorRichard MacCutchan16-Nov-15 20:57 
QuestionCalling base class memeber function in child class member function Pin
Member 121160915-Nov-15 0:50
memberMember 121160915-Nov-15 0:50 
Hi eveeryone,
Can someone please look at my code and teach me where i am making mistake.
 void Laptop::show()
{	Computer::show();
	cout<<"weight is="<<weight<<endl;
	cout<<"height is ="<<height<<endl;
	cout<<"length is ="<<length<<endl;
	cout<<"width is ="<<width<<endl;	
	

}

//In this function Laptop::show is a child class fucntion which is calling Computer::show(); a base class function.but compiler gives error to use .or -> so function Computer::show(); is not called.
Orignal code is given below:

#include<iostream.h>
#include<conio.h>
class Computer
{
protected:
int wordSize;
int memorySize;
int storageSize;
int speed;
public:	
Computer(){}
Computer(int,int,int,int);
void show();
};
class Laptop
{
	private:
int	width;
int	height;
int	length;
int	weight;

public:	
Laptop(){}
Laptop(int,int,int,int,int,int,int,int);
void show();
};
Computer::Computer(int wdSize, int memSize, int storSize ,int spee)
{
	wordSize=wdSize;
	memorySize=memSize;
	storageSize=storSize;
	speed=spee;
}
void Computer::show()
{
	cout<<"Word Size :"<<wordSize<<endl;
	cout<<"Memory Size: "<<memorySize<<endl;
	cout<<"Storage Size"<<storageSize<<endl;
	cout<<"Speed :"<<speed;
}
Laptop::Laptop(int wdSize, int memSize,int storSize, int spee,int wid, int hei , int len , int wait ):Computer(wdSize,memSize,storSize,spee);

	{
		
	width=wid;
	length=len;
	height=hei;
	weight=wait;	
} 
void Laptop::show()
{	Computer::show();
	cout<<"weight is="<<weight<<endl;
	cout<<"height is ="<<height<<endl;
	cout<<"length is ="<<length<<endl;
	cout<<"width is ="<<width<<endl;	
	

}
void main()
{
	clrscr();
	Computer comp(4,512,20,2);
	Laptop lap(8,1024,50,2,15,19,14,2);
	cout<<"Computer Specifications are"<<endl;
	comp.show();
	cout<<":Laptop specifications are"<<endl;
	lap.show();
	getch();
}

AnswerRe: Calling base class memeber function in child class member function Pin
Richard MacCutchan6-Nov-15 3:55
protectorRichard MacCutchan6-Nov-15 3:55 
QuestionATL ACTIVEX UI design Pin
frankzf25-Sep-15 20:35
memberfrankzf25-Sep-15 20:35 
Question64 bits application using Visual Basic 6 ActiveX controls Pin
RUSUA19-Aug-15 2:01
memberRUSUA19-Aug-15 2:01 
AnswerRe: 64 bits application using Visual Basic 6 ActiveX controls Pin
Daniel Pfeffer29-Aug-15 11:55
professionalDaniel Pfeffer29-Aug-15 11:55 
QuestionCString in static library for both MFC and non-MFC projects Pin
peterchen12-Aug-15 11:34
memberpeterchen12-Aug-15 11:34 
AnswerRe: CString in static library for both MFC and non-MFC projects Pin
Albert Holguin20-Oct-15 10:15
professionalAlbert Holguin20-Oct-15 10:15 
Questionvisual studio 2010 error help needed Pin
VScoder125-Jul-15 23:32
memberVScoder125-Jul-15 23:32 
SuggestionRe: visual studio 2010 error help needed Pin
Richard MacCutchan6-Jul-15 0:07
protectorRichard MacCutchan6-Jul-15 0:07 
GeneralRe: visual studio 2010 error help needed Pin
VScoder126-Jul-15 15:45
memberVScoder126-Jul-15 15:45 
GeneralRe: visual studio 2010 error help needed Pin
Richard MacCutchan6-Jul-15 21:46
protectorRichard MacCutchan6-Jul-15 21:46 
GeneralRe: visual studio 2010 error help needed Pin
VScoder126-Jul-15 23:29
memberVScoder126-Jul-15 23:29 
GeneralRe: visual studio 2010 error help needed Pin
Richard MacCutchan6-Jul-15 23:35
protectorRichard MacCutchan6-Jul-15 23:35 
GeneralRe: visual studio 2010 error help needed Pin
VScoder127-Jul-15 1:34
memberVScoder127-Jul-15 1:34 
GeneralRe: visual studio 2010 error help needed Pin
Richard MacCutchan7-Jul-15 1:56
protectorRichard MacCutchan7-Jul-15 1:56 
GeneralRe: visual studio 2010 error help needed Pin
VScoder127-Jul-15 16:11
memberVScoder127-Jul-15 16:11 
GeneralRe: visual studio 2010 error help needed Pin
Brisingr Aerowing7-Jul-15 17:29
professionalBrisingr Aerowing7-Jul-15 17:29 
GeneralRe: visual studio 2010 error help needed Pin
Richard MacCutchan7-Jul-15 22:58
protectorRichard MacCutchan7-Jul-15 22:58 

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 | Cookies | Terms of Service
Web01 | 2.8.190619.2 | Last Updated 3 May 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid