简体   繁体   English

使用 Clion 在 C 编程中读取大文本文件

[英]Reading a large text file in C programming using Clion

I have a problem knowing how to read a large text file in CLion c programming application.我在知道如何在 CLion c 编程应用程序中读取大型文本文件时遇到问题。 I don't know where to include the textfile, what commands to use, if I should use shell or just run the code in Clion etc!我不知道在哪里包含文本文件,使用什么命令,如果我应该使用 shell 还是只在 Clion 中运行代码等等! I am hoping if any of you are experienced with CLion if you could write a step by step from the beginning.如果您能从头开始一步一步地编写,我希望你们中的任何人是否对 CLion 有经验。 I am supposed to read a text file for an assignment and have not been able to start the assignment cause I don't know how to make my C application read the text file!我应该为作业读取文本文件,但无法开始作业,因为我不知道如何让我的 C 应用程序读取文本文件!

Would be incredibly grateful if anyone could take their time and help me!如果有人能花时间帮助我,将不胜感激!

All the best, A beginner in programming一切顺利,编程初学者

Step 1 - write your code第 1 步 - 编写代码

在此处输入图片说明

Step 2 - pass location file as argument by configuring execution settings步骤 2 - 通过配置执行设置将位置文件作为参数传递

在此处输入图片说明

Step 3 - set location of the file as program argument第 3 步 - 将文件位置设置为程序参数

在此处输入图片说明

Step 4 - have fun with C programming ;)第 4 步 - 享受 C 编程带来的乐趣;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM