打开并输出文本文件

编程入门 行业动态 更新时间:2024-10-11 19:15:59
本文介绍了打开并输出文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 我想打开一个.txt文件并显示它。没有阅读或任何东西,只是在人们输入一定数字时显示它。 谁能告诉我怎么做? 并且是否有关闭应用程序所有窗口的命令? 我在BORLAND做C ++

解决方案

大家好, 我想打开一个.txt文件,只是显示它。没有阅读或任何东西,只是在人们输入一定数量时显示它。 有人能告诉我怎么做吗? 并且是否有一个命令可以关闭应用程序的所有窗口? IM在CORLAND中使用C ++ b

传输 - 这将帮助您打开文件,阅读内容,然后您可以将其打印到屏幕上: www.cplusplus/doc/tutorial/files.html 你可以在一段时间内使用case(switch)语句用户输入的循环以及何时显示,如果您需要帮助,请查看thescripts的教程: www.thescripts/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: www.cplusplus/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''s tutorial: www.thescripts/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;

更多推荐

打开并输出文本文件

本文发布于:2023-11-24 05:58:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1624169.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文本文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!