免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1399 | 回复: 1
打印 上一主题 下一主题

[Linux] linux初学者的程序疑问 [复制链接]

论坛徽章:
2
2015年迎新春徽章
日期:2015-03-04 10:01:44程序设计版块每日发帖之星
日期:2015-06-28 22:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-04-14 21:55 |显示全部楼层 |倒序浏览
在cygwin下执行如下程序:
#include <unistd.h>
#include <stdlib.h>

int main()
{
        if ((write(1,"here is some data\n",1)!=1
                write(2,"A write error has occurred on file descriptor 1\n",46);
                exit(0);
}

执行失败,报如下错误:
$ ./simple_write.c
./simple_write.c: line 4: syntax error near unexpected token `('
./simple_write.c: line 4: `int main()'

论坛徽章:
2
2015年迎新春徽章
日期:2015-03-04 10:01:44程序设计版块每日发帖之星
日期:2015-06-28 22:20:00
2 [报告]
发表于 2014-04-14 21:57 |显示全部楼层
程序怎么会将数字变成表情了呢? 重新贴一遍
#include <unistd.h>
#include <stdlib.h>

int main()
{
        if ((write(1,"here is some data\n",1)!=1
                write(2,"A write error has occurred on file descriptor 1\n",46);
                exit(0);
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP