user1023696
user1023696

Reputation: 43

How to copy turbo c++ output?

How to copy turbo c++ output? I already Googled the problem but in vain. It says press print scrn and paste or right click and mark all and paste. I tried the both but not working. The problem is that it's only copying what is present on the current screen. But I want the whole screen from the beginning. (alt+printscrn not working either). How can I tackle this situation.

printScrn
Alt+printScrn
markall

none of them are working !!

for some reason i need this old way of programming i can't help with it but i would like to get a solution for the same . i have tried redirecting the output stream to the the file this way but it won't works .

#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();
}

Upvotes: 0

Views: 28207

Answers (5)

Spacey Men
Spacey Men

Reputation: 21

I've tried one thing, and it worked, albeit it contains a handful number of steps.

  • Compile and Run your program, and exit to the editor window
  • Now, Go to "Window" tab menu > "Output"
  • The Output window opens, now open the "Edit" menu > select "Copy" > then again open the "Editor" menu > select "Show clipboard"
  • The Clipboard window opens up, now select "File" menu > "Save As", and save the file in a .txt file at an appropriate location.
  • You can browse to that location in explorer to get the text file.

Upvotes: 2

Harshita
Harshita

Reputation: 11

Run the Program. open the output using Window->Output . then go to Edit->Show clipboard then save the file with any other name Then open My computer/This Pc .Click on Local disk (C:)->TurboC4->TC->BIN and right click on the name of the file select Edit the file will open in Notepad Then save the file as per your requirement using Save As option. Hope this helps you.

Upvotes: 1

Vivek Dhiman
Vivek Dhiman

Reputation: 429

  1. Run your program.
  2. Now Right Click on black screen
  3. Select Mark option
  4. Now Drag Mouse pointer to the Area u want to copy by pressing left mouse button. The area will be highlighted will while background.
  5. Press Enter.
  6. Open Your word document.
  7. Select Paste option from Edit Menu (or Press Ctrl+v)

Upvotes: 0

3Demon
3Demon

Reputation: 550

Buddy, follow these steps :-

  1. Press PrintSrc on the output screen
  2. The screen gets captured
  3. You can only paste it a rich text document like MS-WORD
  4. Then right click on the image inside the WORD and click on save as an image.

:-)

Upvotes: 0

fredoverflow
fredoverflow

Reputation: 263320

You can always capture the output of a program by redirecting the standard output stream.

Suppose your program is called exercise1.exe. Then you can call it like that from the command line:

exercise1 >awesome.txt

Then you can simply open awesome.txt with the text editor of your choice and see the entire output.

Upvotes: 1

Related Questions