【发布时间】:2012-11-20 21:00:50
【问题描述】:
我正在尝试从 Sam's Learn C in 24 Hours 编译一个示例。
当我尝试编译以下代码时出现错误:
/* 03L02.c: Calculate an addition and print out the result */
#include <stdio.h>
/* This function adds two integers and returns the result */
int integer_add( int x, int y )
{
int result;
result = x + y;
return result;
}
int main()
{
int sum;
sum = integer_add(5, 12);
printf(“The addition of 5 and 12 is %d.\n”, sum);
return 0;
}
这是我的编译器给出的错误:
In function main
stray "\147\' in program
The undeclared identifier is declared only once
for each function it appears in
syntax error before addition
stray "\' in program
stray "\148' in program
提前致谢。
【问题讨论】:
-
看起来您的“引号”字符不正确。您使用的是“而不是默认的”
-
看起来你从某个地方复制了代码..