0

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

5 回答 5

2

我已经尝试过一件事,它奏效了,尽管它包含一些步骤。

  • 编译并运行您的程序,然后退出到编辑器窗口
  • 现在,转到“窗口”选项卡菜单>“输出”
  • 输出窗口打开,现在打开“编辑”菜单>选择“复制”>然后再次打开“编辑器”菜单>选择“显示剪贴板”
  • 剪贴板窗口打开,现在选择“文件”菜单>“另存为”,然后将文件保存在适当位置的 .txt 文件中。
  • 您可以在资源管理器中浏览到该位置以获取文本文件。
于 2017-02-17T17:39:16.797 回答
1

您始终可以通过重定向标准输出流来捕获程序的输出。

假设您的程序被称为exercise1.exe. 然后你可以从命令行这样调用它:

exercise1 >awesome.txt

然后,您可以简单地awesome.txt使用您选择的文本编辑器打开并查看整个输出。

于 2013-09-09T09:53:02.317 回答
1

运行程序。使用Window->Output打开输出。然后去编辑->显示剪贴板 然后用任何其他名称保存文件然后打开我的电脑/这台电脑。单击本地磁盘(C:)->TurboC4->TC->BIN并右键单击文件名选择编辑 文件将在记事本中打开然后使用另存为选项 根据您的要求保存文件 。希望这对您有所帮助。

于 2016-10-08T12:12:04.257 回答
0

伙计,请按照以下步骤操作:-

  1. 在输出屏幕上按 PrintSrc
  2. 屏幕被捕获
  3. 您只能将其粘贴为 MS-WORD 之类的富文本文档
  4. 然后右击WORD里面的图片,点击另存为图片。

:-)

于 2014-11-30T18:54:31.410 回答
0
  1. 运行你的程序。
  2. 现在右键单击黑屏
  3. 选择标记选项
  4. 现在通过按鼠标左键将鼠标指针拖动到要复制的区域。该区域将在背景时突出显示。
  5. 按 Enter。
  6. 打开你的word文档。
  7. 从编辑菜单中选择粘贴选项(或按 Ctrl+v)
于 2015-05-07T14:00:20.503 回答