在windows下写的c程序
// #include<iostream>
#include"D:\文件(代码,程序,图)\C文件\sub1.h"
using namespace std;
int main()
{
printf("%f\n",x2x(14.6,13.5));
}
//#include<iostream>
using namespace std;
float x2x(float a,float b)
{
return a+b;
}
在ubuntu中利用vim写c文件,然后用gcc进行编译![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/b653eea5be93ccab4e82c05ea0bd1f08.png)
在Ubuntu中makefile进行编译
makefile的使用方法
下面展示一些 内联代码片
。
// target:prerequisites
command # command以一个tab键开始
# target为一个目标文件,可以是Object File,也可以是执行文件。还可以是一个标签(Label)
# prerequisites是需要生成target所依赖的文件或是目标
# command也就是make需要执行的命令。(任意的Shell命令)