---
title: "黑马程序员-在控制台输出一个文字"
author: "thinktothings"
date: "2014-04-23T23:20:39Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2014-04-23T23:22:40Z"
id: 2053880
url: "https://thinktothings.iteye.com/blog/2053880"
---

# ------- [android培训](http://www.itheima.com/)、[java培训](http://www.itheima.com/)、[ios培训](http://www.itheima.com/)、期待与您交流！ ----------

 

 

命令学习

cc   -c   源文件名称        (编译源文件)

cc        编译后的文件   ( 编译后的.o文件)

./ 可执行文件      (转换成可执行文件.out)

\\n   是换行的意思

 

 

1.c语言写的源文件    a.c        执行命令      cc -c  a.c   会生成    a.o  文个把，此文件为编译后的文件

2.运行编译后的文件    cc    a.o  文件，会生成一个    a.out文件

3.执行编译后的结果      ./a.out     执行当前目录下的 a.out文件，打印输出

a.c 文件，源代码

 

&lt;&lt;a.c&gt;&gt;

 

#include&lt;stdio.h&gt;

 

int main()

{

     printf("第一个程序");

     printf("第一个程序\\n");

     printf("第一个程序\\n");

     return 0;

}

 

 

1写源文件

2.编译源文件

3.链接编译后的文件跟系统自带的函数库合并在一起，生成一个可执行文件

4.运行

 

 

cc    d.c     -o    d.out