C 语言基础-初识
2018-03-08 15:37
232 查看
1.为什么要使用 C?
C 语言所产生的代码运行速度与汇编语言编写的代码运行速度几乎一样2.C 环境设置
2.1 Linux 查看
gcc -v使用内建 specs。 COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper 目标:x86_64-linux-gnu 配置为:../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu 线程模型:posix gcc 版本 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
2.1 Window下安装
Minimal GNU on Windows 主页 www.mingw.org,的下载地址https://sourceforge.net/projects/mingw/?source=typ_redirect
mingw-get-setup.exe
3.Hello World
示例HelloWorld.c
# include <stdio.h> int main() { printf("%s\n", "Hellow world"); return 0; }
运行
1. 编译 gcc HelloWorld.c,生成默认执行文件名
2. 运行 ./a.out
suhuazhi@chenxiaoping-PC:~/C_Study/HelloWorld$ gcc HelloWorld.c suhuazhi@chenxiaoping-PC:~/C_Study/HelloWorld$ ls a.out HelloWorld.c suhuazhi@chenxiaoping-PC:~/C_Study/HelloWorld$ ./a.out Hellow world
相关文章推荐
- 初识Java(Java语言基础-数据类型转换)
- R语言基础指令和并行算法初识(上篇)
- Linux初识(二)与C语言基础(一)
- 初识Java (Java语言基础-运算符)
- 初识MySQL之——SQL语言基础
- 初识Java (Java语言基础-数据类型)
- C语言基础之结构体
- JavaScript语言基础知识6
- c语言基础深入理解二
- 【C语言基础】1-2 C语言基础代码
- C语言基础知识学习记录
- C#语言基础02
- 80x86汇编语言基础宏指令
- C语言2011计算机二级c语言考点:c语言的基础知识
- 奶爸业余单片机学习之:C语言基础——指针(指针变量)学习笔记之二
- C语言基础整理
- C++ Primer Part I, 语言基础,2-7章
- 黑马程序员——C语言基础语法、基本运算理论
- 黑马程序员--C语言基础-字符串相关知识点整理
- linux基础(vi颜色,压缩文件,系统语言)