6. int x, y; 7 public : void sum () 9申{ cout<display(); 30 ptr->sum(); 31 - } // run time binding // compile time binding 32 88 Compiler (3) Resources dh Compile Log V Debug Find Results Close Line Col File Message C:\Users\Mohit Bhagat\Documents\C++ Code\QBS Progra. In function 'int main()': C:\Users\Mohit Bhagat\Documents\C++ Code\QBS Program. [Error] expected ;' before 'obj C:\Users\Mohit Bhagat\Documents\C++ Code\QBS Program. [Error] 'obj' was not declared in this scope 27 5 28

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

Please Fix this probem.

C:\Users\Mohit Bhagat\Documents\C++ Code\QBS Program Compling.cpp - Dev-C++ 5.11
File Edit Search View Project Execute
Tools AStyle Window Help
國
(globals)
Project Classes Debug
QBS Program Compling.cpp
E complex
main: dass
#include<iostream>
2
#include<conio.h>
using namespace std;
class base
3
4
59 {
int x, уs
public :
void sum ()
9日{
7
10
cout<<x+y;
}
virtual void display ()
13E {
cout<< "display";
}
};
class derived : public base
18 E {
int x, y;
public :
void display ();
void sum ();
};
int main ()
25 E {
base*ptr;
ptr obj;
ptr= &obj;
ptr->display();
ptr->sum();
}
11
12
14
15
16
17
19
20
21
22
23
24
26
27
23
// run time binding
// compile time binding
29
30
31
32
88 Compiler (3) G Resources dh Compile Log V Debug 3 Find Results Close
Line
Col
File
Message
C:\Users\Mohit Bhagat\Documents\C++ Code\QBS Progra. In function 'int main()':
27
C:\Users\Mohit Bhagat\Documents\C++ Code\QBS Program. [Error] expected ;' before 'obj'
28
7
C:\Users\Mohit Bhagat\Documents\C++ Code\QBS Program. [Error] 'obj' was not declared in this scope
Transcribed Image Text:C:\Users\Mohit Bhagat\Documents\C++ Code\QBS Program Compling.cpp - Dev-C++ 5.11 File Edit Search View Project Execute Tools AStyle Window Help 國 (globals) Project Classes Debug QBS Program Compling.cpp E complex main: dass #include<iostream> 2 #include<conio.h> using namespace std; class base 3 4 59 { int x, уs public : void sum () 9日{ 7 10 cout<<x+y; } virtual void display () 13E { cout<< "display"; } }; class derived : public base 18 E { int x, y; public : void display (); void sum (); }; int main () 25 E { base*ptr; ptr obj; ptr= &obj; ptr->display(); ptr->sum(); } 11 12 14 15 16 17 19 20 21 22 23 24 26 27 23 // run time binding // compile time binding 29 30 31 32 88 Compiler (3) G Resources dh Compile Log V Debug 3 Find Results Close Line Col File Message C:\Users\Mohit Bhagat\Documents\C++ Code\QBS Progra. In function 'int main()': 27 C:\Users\Mohit Bhagat\Documents\C++ Code\QBS Program. [Error] expected ;' before 'obj' 28 7 C:\Users\Mohit Bhagat\Documents\C++ Code\QBS Program. [Error] 'obj' was not declared in this scope
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY