我如何打开.c文件 [英] How do I open a .c file

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

问题描述



大家好,这就是问题,教授给我发了一个.c文件进行编辑,我知道这是用C或C ++软件完成的,我找不到打开这个方法的方法,我下载了代码块而且根本没用(或者我遗漏了什么)..你能不能帮帮我吗?



将给出5颗星的准确答案。



如果您需要.C文件,请告诉我。

解决方案

拥有C程序源代码是不够的,你也需要一个编译器。然后,编译器需要在哪里找到标题的引用(位置)(如果源代码中有任何标题)。这些头文件需要由编译器访问,以链接它们并创建可执行文件。



所以,仅仅Code :: Blocks或Dev C ++是不够的。您必须了解程序的实际创建方式。



1.用C编程语言编写程序。

- 正如PIEBALDconsult对你的问题的评论所述,你可以写什么程序......任何事情。无需安装Visual Studio!

2.确保您拥有该语言的编译器。如果您不打算安装IDE,那么GCC就是您的选择! CCC的GCC编译器 [ ^ ]将编译源代码并为您提供可执行文件。对于那个C源文件。

3.编译器,如果发现任何错误,将通知您!所以,确保修复它们。 (稍后讨论)

4.执行创建的可执行文件以查看输出。

- 这取决于框架,在Windows上,您可以双击并在基于Linux的系统上打开控制台,以查看您可能希望首先在该位置打开终端的输出。



现在,这就是整个过程。如果你理解它,那很好,如果你没有。从步骤1开始执行以下步骤(并执行步骤)。



您提到的内容,错误。错误是因为编译器不理解你写的内容。编译器足够聪明,但不够聪明,无法为您解决问题。 :-)



所以你必须自己解决问题。在C的情况下,这可能是一个令人头痛的问题。如果你无法解决,我建议你联系你的老师并请他帮你。 : - )


Hello guys, here is the thing, a professor sent me a .c file to edit it, I know that this was done un C or C++ Software, I cannot find the way to get this opened, I downloaded codeblocks and no worked at all (or I am missing something).. could you please help me with it?

5 stars for accurate answers will be given.

Please let me know if you need the .C file.

解决方案

Having a C program source code is not enough, you need to have a compiler too. Then, compiler would need the references (locations) where to find the headers (if there are any in the source code). Those headers need to be accessible by the compiler, to link them and create an executable.

So, just the Code::Blocks or Dev C++ is not enough. You have to understand how a program is actually created.

1. You write the program in C programming language.
- As mentioned in comment to your question, by PIEBALDconsult, you can write the program in anything... Anything. There is no need to have Visual Studio installed!
2. Make sure you are having a compiler for that language. If you are not going to install an IDE, GCC is your bet! GCC compiler for C[^] would compile the source code and give you an executable. For that C source file.
3. Compiler, if finds any errors, will notify you! So, ensure to fix them. (Coming to this point later)
4. Execute the executable file created to see the output.
- It depends on frameworks, on Windows you can double click and a console will open, on Linux-based systems, to see the output you may want to open a terminal at that location first.

Now, that is the entire process. If you understood it, great, if you didn't. Start by following (and performing the steps) from the step 1.

The thing you mentioned, "errors" in it. The errors are because the compiler doesn't understand what you wrote. Compiler is smart enough, but not smart enough to solve the problems for you. :-)

So you have to solve the problems yourself. In case of C, that can be a headache. If you cannot solve them, I recommend you contact your teacher and ask him to help you out. :-)


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

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