打开并输出文本文件 [英] Opening and outputting a text file

查看:95
本文介绍了打开并输出文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我想打开一个.txt文件并显示它。没有阅读或任何东西,只是在人们输入一定数字时显示它。

谁能告诉我怎么做?


并且是否有关闭应用程序所有窗口的命令?


我在BORLAND做C ++

解决方案


大家好,

我想打开一个.txt文件,只是显示它。没有阅读或任何东西,只是在人们输入一定数量时显示它。

有人能告诉我怎么做吗?


并且是否有一个命令可以关闭应用程序的所有窗口?


IM在CORLAND中使用C ++ b



传输 -


这将帮助您打开文件,阅读内容,然后您可以将其打印到屏幕上:

<一个rel =nofollowhref =http://www.cplusplus.com/doc/tutorial/files.html目标=_ blank> http://www.cplusplus.com/doc/tutorial/files.html

你可以在一段时间内使用case(switch)语句用户输入的循环以及何时显示,如果您需要帮助,请查看thescripts.com的教程:

http://www.thescripts.com/serverside...ops/index.html


这应该可以帮助你开始!


谢谢,但我的意思是打开.txt文件就像你双击它一样。

对不起,如果我没解释好的话!


你知道如何关闭整个程序吗?我试过abort()但是没有给我我想要的东西!


thx已经!!



谢谢,但我的意思是打开.txt文件,就像你双击它一样。

对不起,如果我没解释好的话!


你知道如何关闭整个程序吗?我试过abort()但是没有给我我想要的东西!


thx已经!!



我猜你正在使用Windows,我不完全确定如何打开它 - 因为它涉及打开Word / TextPad的系统命令/记事本打开文件...您可以随时自己打开它并在屏幕上打印(除非您希望某人能够编辑它...)。但这不应该太难以谷歌并找出 - 我猜它会使用''windows.h'来运行任何可执行文件,并可能将文件作为参数发送?我不是一个windows家伙,所以我不太确定......(抱歉!)


您可以通过返回1结束程序或返回0;


Hi everyone,

I want to open a .txt file and just show it.Not for reading or anything but just showing it when people enter a certain number.
Can anyone tell me how to do this?

and is there a command to close all windows of the application?

IM DOING C++ IN BORLAND

解决方案

Hi everyone,

I want to open a .txt file and just show it.Not for reading or anything but just showing it when people enter a certain number.
Can anyone tell me how to do this?

and is there a command to close all windows of the application?

IM DOING C++ IN BORLAND

Transmit -

This will help you open a file, read stuff in, and then you can print it out to the screen:

http://www.cplusplus.com/doc/tutorial/files.html

You could use a case (switch) statement in a while loop for the user input and when to display, if you need help on that, check out thescripts.com''s tutorial:

http://www.thescripts.com/serverside...ops/index.html

That should get you started!


Thanks, but I actually meant opening the .txt file like when you would double click on it.
Sorry if I didn''t explain well!

and do you know how to close the whole program? I tried abort() but that didn''t gave me what I wanted!

thx already!!


Thanks, but I actually meant opening the .txt file like when you would double click on it.
Sorry if I didn''t explain well!

and do you know how to close the whole program? I tried abort() but that didn''t gave me what I wanted!

thx already!!

I would guess you are using Windows, and I''m not entirely sure how to open it like that - as it involves a system command to open Word/TextPad/Notepad to open the file up... You can always just open it yourself and print it on the screen (unless you want someone to be able to edit it...). But that shouldn''t be too hard to google and find out - I would guess it uses ''windows.h'' to run whatever the executable is, and possibly send the file as a parameter? I''m not a windows guy, so I''m not too sure... (sorry!)

You can end the program through return 1 or return 0;


这篇关于打开并输出文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆