最新回答 / qq__3559
因为文件hello.c的printLine()函数和test.c中的say()函数是被相互引用的,因此这两个函数都应为外部函数,在两个文件中都必须声明引用。具体代码如下:补充:extern的主要作用不在于定义外部变量或函数,而在于引用定义,如果在其他编译器中去掉#include”test.c",不然会出现重定义(例如visual studio)。hello.c文件中:#include <stdio.h>#include "test.c" //引用test.c文件extern void sa...
2015-01-07
已采纳回答 / 偌颜宁
格式化字符串包括两部分内容: 一部分是正常字符, 这些字符将按原样输出; 另一部分是格式化规定字符, 以"%"开始, 后跟一个或几个规定字符,用来确定输出内容格式。这个是C语言自身的写法,所以字符串常量是可以不用格式符的
2015-01-07
In function 'main':
error: stray '\357' in program
运行结果如下:error: stray '\274' in program
error: stray '\233' in program
error: expected ';' before 'printf'
warning: no newline at end of file
怎么办?
error: stray '\357' in program
运行结果如下:error: stray '\274' in program
error: stray '\233' in program
error: expected ';' before 'printf'
warning: no newline at end of file
怎么办?
2015-01-07