c_cpp 用C编译环境命令

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp 用C编译环境命令相关的知识,希望对你有一定的参考价值。

Instructions for CS50 IDE: https://docs.cs50.net/2018/x/psets/1/pset1.html

To compile: clang hello.c

after compiling, if there's no error, an output executable file called a.out is automatically formed. 

To run the executable file: ./a.out

Here the "./" just means stay in the current folder.

If we make some changes in the original code, we have to compile again, and then run it.

clang hello.c
./a.out

If we don't want the default "a.out" file, and give the executable file a name that we want. we can use this command:

clang -o hello hello.c

so after this command is executed, in the folder there will be not just a.out, but also a "hello" file. 

To run the program, we can just type:

./hello

To shorten the command clang -o hello hello.c, in this IDE they made the command “make” to do all this:

make hello

Clear all the screen: Ctrl + L
Clear the current line: Ctrl + U
  So this will delet whatever you just typed in the current line, and the curser goes to the beginning of the line. So this saves you from pressing delet key lots of times if you have typed a long line of commands that you want to delet.
  

以上是关于c_cpp 用C编译环境命令的主要内容,如果未能解决你的问题,请参考以下文章

用csc命令行手动编译cs文件

c语言中怎么用命令提示窗口编译宏定义并打印出来!请指教.谢谢了.

debian怎么搭建c语言编译环境

c_cpp C(编译器)有四个函数

用csc命令行手动编译cs文件

c_cpp ANSI C中的最小Forth编译器