c。通过在线读取文本文件到阵列产品线,并打印出来 [英] c reading a text file into array line by line and print them

查看:99
本文介绍了c。通过在线读取文本文件到阵列产品线,并打印出来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有下面的C#code段

i have the following c# code snippet

              string[] lines = File.ReadAllLines(@"C:\test.txt");
              for(int i=0; i<lines.Length; i++)
                  Console.WriteLine(lines[i]);

你能帮我把它转换为C。

Can you help me to convert it to C.

谢谢!

推荐答案

如果您打算使用ANSI标准C,你需要的fopen 与fgets 的printf 做你想要什么。

If you plan to use Ansi Standard C, you'll need fopen, fgets, and printf to do what you want.

下面的一个教程,几乎不正是你想要什么

这篇关于c。通过在线读取文本文件到阵列产品线,并打印出来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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