现在的位置: 首页 > 综合 > 正文

compiler error output to a file named err

2013年10月10日 ⁄ 综合 ⁄ 共 301字 ⁄ 字号 评论关闭

root@sunny-desktop:~/Desktop# cat test.c

#include<stdio.h>
void dive()
{
    int a = 0
    int b = 12 / a;
}

void main()
{
    dive();
    printf("aaf");
}

root@sunny-desktop:~/Desktop# gcc test.c 2>err

root@sunny-desktop:~/Desktop# cat err

test.c: In function ‘dive’:
test.c:5: error: expected ‘,’ or ‘;’ before ‘int’

root@sunny-desktop:~/Desktop#

抱歉!评论已关闭.