三木社区
标题:
ex007-函数调用
[打印本页]
作者:
sunlichao
时间:
2017-6-22 12:10
标题:
ex007-函数调用
操作系统:ubuntu14.04
编辑器:vim
编译器:gcc5.4
参考:
1.嵌入式系统开发C语言入门手册:
https://item.taobao.com/item.htm?spm=a1z10.5-c.w4002-1875586561.24.zFa4am&id=542284250479
复制代码
2.嵌入式系统开发C语言数据结构入门手册:
https://item.taobao.com/item.htm?ft=t&spm=2013.1.0.0.EsglU0&id=542335071854&scm=1007.12144.81309.42296_0&pvid=8134509f-5964-4736-ab70-879f6f99d4e0
复制代码
示例代码:
//头文件引用
#include<stdio.h>
//定义个字符串
#define str "hello world"
//函数声明
void func(void);
//主函数
int main()
{
//函数调用
func();
//返回0
return 0;
}
/*
函数功能:输出字符串
输入参数:无
返回参数:无
函数说明:无
*/
void func(void)
{
printf("%s\n",str);
}
复制代码
运行结果:
hello world
复制代码
欢迎光临 三木社区 (http://www.sanmulink.com/)
Powered by Discuz! X3.3