How to copy turbo c output

0 votes

How can I replicate the output of Turbo C++? 

I had already Googled the issue, but in vain. 

It suggests to either print scrn and paste or right click, select all, and paste. 

I tried both, but neither worked. 

The issue is that it simply copies what is on the current screen. 

But I want the entire screen from the start. 

(Alt+printscrn is also ineffective). 

What should I do in this situation?

printScrn
Alt+printScrn
markall

None of them are operational!!

I can't assist you if you require this archaic technique of programming for whatever reason, but I'd want to find a solution. 

I tried forwarding the output stream to the file in this manner, but it did not work.

#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
const int max=50;
class dequeue{
int dq[max],r,f,c,x,i;
public:
dequeue();
void insertRear();
void insertFront();
void deleteFront();
void display();
};
dequeue::dequeue(){
f=r=-1;
c=0;
}
void dequeue::insertRear()
{
if((f==r+1)||(f==0)&&(r==max-1)){
cout<<"overflow";
return;
}
if(f==-1)
f=r=0;
else
{
if(r==max-1)
r=0;
else
r++;
}
cout<<"enter element";
cin>>x;
dq[r]=x;
c++;
}
void dequeue::insertFront(){
if((f==r+1)||(f==0)&&(r==max-1)){
cout<<"overflow";
return;
}
if(f==-1)
f=r=0;
else
{
if(f==0)
f=max-1;
else
f++;
}
cout<<"enter element:";
cin>>x;
dq[f]=x;
c++;
}
void dequeue::deleteFront(){
if(f==-1){
cout<<"deque empty";
return;
}
x=dq[f];
c--;
if(f==r)
f=r=-1;
else{
if(f==max-1)
f=0;
else
f++;
}
cout<<x<<"deleted!!!";
}
void dequeue::display(){
if(f==-1){
cout<<"dequeue empty";
return;
}
cout<<"\n"<<c<<"item in deque are:";
cout<<"\n(front)";
i=f;
if(i!=-1){
while(1){
cout<<" "<<dq[i];
if(i==r)
break;
if(i==max-1)
i=0;
else
i++;

}
}
cout<<"(rear)";
}
void main(){
freopen("output.txt","w",stdout); //this is not working
clrscr();
dequeue d;
int ch;
do{
cout<<"\n Menu";
cout<<"\n 1.insert at front";
cout<<"\n 2.insert at rear";
cout<<"\n 3.delet from front";
cout<<"\n 4.display";
cout<<"\n 5.exit \n";
cout<<"Enter your choice:";
cin>>ch;
switch(ch){
case 1:
d.insertFront();
break;
case 2:
d.insertRear();
break;
case 3:
d.deleteFront();
break;
case 4:
d.display();
break;
case 5:
exit(0);
break;
default:
cout<<"\n invalid";
}
}
while(ch!=5);
getch();
}
Jul 7, 2022 in C++ by Nicholas
• 7,760 points
1,184 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In C++

0 votes
1 answer

How to use std::sort to sort an array in C++

We receive std::begin and std::end in C++0x/11, which are overloaded for arrays: #include <algorithm> int main(){ int v[2000]; ...READ MORE

answered Jun 1, 2022 in C++ by Damon
• 4,960 points
895 views
0 votes
0 answers

How to traverse stack in C++?

Is traversing std::stack possible in C++? It is not possible to traverse using the following method.  Because there is no member end in std::stack. std::stack<int> foo; // .. for (__typeof(foo.begin()) it = foo.begin(); ...READ MORE

Jun 1, 2022 in C++ by Nicholas
• 7,760 points
1,642 views
0 votes
1 answer

How to use new[ ] and delete[ ] operator in C++

int main(){ char *str; ...READ MORE

answered Jun 20, 2022 in C++ by Damon
• 4,960 points
360 views
0 votes
1 answer

How to use enums in C++

This will be sufficient to declare your ...READ MORE

answered Jun 20, 2022 in C++ by Damon
• 4,960 points
398 views
0 votes
1 answer

How to convert string to char array in C++?

Simplest way I can think of doing ...READ MORE

answered Jun 20, 2022 in C++ by Damon
• 4,960 points
4,807 views
0 votes
0 answers

How to use c++ swap function?

It is OK to write swap(a,b); There is an issue when I write swap(&c[0],&d[0]);.  Can anyone explain why? #include<iostream> #include<algorithm> using namespace std; int main(void){ ...READ MORE

Jul 1, 2022 in C++ by Nicholas
• 7,760 points
191 views
0 votes
0 answers

Programming slim C++ programs (like uTorrent) for Windows

What methods do you recommend for writing ...READ MORE

May 13, 2022 in Others by Kichu
• 19,050 points
265 views
0 votes
1 answer

outputting ascii table in C++

This line doesn't do the right thing: ch ...READ MORE

answered Jun 13, 2022 in C++ by Damon
• 4,960 points
758 views
0 votes
1 answer

Has Windows an integrated built-in C/C++ compiler package?

Microsoft does not offer a compiler or ...READ MORE

answered Jun 14, 2022 in C++ by Damon
• 4,960 points
935 views
0 votes
1 answer

Difference between Turbo C++ and Borland C++ compiler [closed]

I will try my best to respond, ...READ MORE

answered Jun 21, 2022 in C++ by Damon
• 4,960 points
803 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP