三木社区
标题:
ex006-宏定义一个字符串
[打印本页]
作者:
sunlichao
时间:
2017-6-22 11:30
标题:
ex006-宏定义一个字符串
操作系统: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"
//主函数
int main()
{
printf("%s\n",str);
return 0;
}
复制代码
运行结果:
hello world
复制代码
欢迎光临 三木社区 (http://www.sanmulink.com/)
Powered by Discuz! X3.3