如何从文件中读取输入和写入输出在C另一个文件 [英] How to read inputs from a file and to write outputs to another file in C

查看:169
本文介绍了如何从文件中读取输入和写入输出在C另一个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是C.很好的我怎样才能让我的程序从文件中读取输入和写入输出到另一个文件
用C?

I not very good at C. How can I make my program read inputs from a file and to write outputs to another file in C?

推荐答案

对于C ++,有很好的例子的这里和<一个href=\"http://stackoverflow.com/questions/2285900/read-and-write-bytes-from-a-file-c/2285920#2285920\">here.

For C++, there are great examples here and here.

有关C,检查这个参考。它打开一个文件,在写入的东西,然后再从中读取。这是pretty多少你所寻找的。
此外,这个页面是伟大的,因为它解释的fopen / FREAD / FWRITE在详细信息。

For C, check this reference. It opens a file, writes something on it, and then reads from it. It's pretty much what you are looking for. Also, this page is great as it explains fopen/fread/fwrite in detail.

这篇关于如何从文件中读取输入和写入输出在C另一个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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