DAY3|编个"hello world"的C程序先~
今天要编个最简单的"hello world"的C程序,算是初步感受下Linux中的编程环境,涉及以下3个步骤:
1. 先在"vim"里编写源文件;
2. 然后再用"gcc"编译生成"hello"的可执行文件;
3. 运行"hello",看看效果。
那么开始吧!
1. vim
vim hello.c
i
#include <stdio.h>
int
main (void)
{
printf ("hello.\n");
return 0;
}
ESC
ZZ
2. gcc
gcc -Wall hello.c -o hello
3. 运行程序
./hello
相关文档:
操作系统:linux debian 4.0, python版本2.5
s1:安装python2.5-dev。因为Python.h是在dev包中才有。
test@debian:~/test_python_c$ aptitude search python2.5-dev
p python2.5-dev - Header files and a static library for Python.
test@debian:~/test_python_c$ sudo aptitude install python2 ......
C程序是由一组或是变量或是函数的外部对象组成的。 函数是一个自我包含的完成一定相关功能的执行代码段。下面小编和大家分享下C语言中的函数。
1. setfillpatterne函数
setfillpatterne函数的功能是选择用户定义的填充模式,其用法为:void far setfillpattern(char far *upattern, int ......
C/S是客户端/服务器端,C/S的程序通常也叫胖客户端,也就是一个程序的大部分功能,都在客户端实现,而服务器端只实现一小部分功能。通过这点不难看出,C/S的程序大部分在客户端实现,对于服务器端的压力相对小一些,服务器端可以节省一些。而且C/S的程序用窗口来做,个人认为开发效率上快一点。但C/S的程序一大弊端就是,必 ......
C程序是由一组或是变量或是函数的外部对象组成的。 函数是一个自我包含的完成一定相关功能的执行代码段。下面小编和大家分享下C语言中的函数。
1. setwritemode函数
setwritemode函数的功能是设置图形方式下画线的输出模式,其用法为:void far setwritemode(int mode);程序实例如下:
#include < ......
转自: http://hi.baidu.com/elliott_hdu/blog/item/411421dd5bf8dfe977c63876.html
1.下列程序的输出结果为:(B)
#include<iostream.h>
void main()
{
char* a[ ] = { "hello", "the", "world"};
char** pa = a;
&nbs ......