LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 778|回复: 2

新手,按书上敲的,结果还是出错!

[复制链接]
发表于 2010-1-3 20:54:19 | 显示全部楼层 |阅读模式
代码helper.h:
/*
* helper.h - Header for helper.c
*/

void msg (void)

代码helper.c:
/*
* helper.c - Helper code for howdy.c
*/

#include <stdio.h>

void msg (void)
{
        printf ("This message set for jupiter.\n");
}



代码howdy.c:
/*
* howdy.c - Modifed "Hello,World!"
*/
#include <stdio.h>
#include "helper.h"
#include <string.h>

int main (void)
{
printf ("Hello, Linux programming world!\n");
msg();
return 0;
}

错误提示:
[root@Tomcat ~]# gcc howdy.c helper.c -o howdy
howdy.c: In function 'msg':
howdy.c:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
howdy.c:12: error: expected '{' at end of input
发表于 2010-1-3 21:16:19 | 显示全部楼层
呵呵!
代码helper.h:
/*
* helper.h - Header for helper.c
*/

void msg (void)

这里错了,再对下书!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-1-4 21:35:22 | 显示全部楼层
没错,少了;号,呵呵,真是不好意思,基础不够扎实
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表