指针和C的数组 [英] Pointers and arrays of C
问题描述
亲爱的所有
i编译器的源代码问题
源码在线编译结果
拜托,帮我知道结果
谢谢
我尝试了什么:
尽我所能我知道
i重试重写源代码
dear all
i got problem to compiler the source code
source online compiler result
please,help me know the result
thank you
What I have tried:
do my best about i know
i retry rewrite the source code
推荐答案
从查看开始在你的错误信息中:他们的英语非常好,而且 - 非常清楚 - 非常清楚。
Start by looking at your error messages: they are in perfectly good English, and are - surprisingly - very clear.
prog.c:3:6: warning: return type of ‘main’ is not ‘int’ [-Wmain]
void main(void)
正确:你已经把它写成了void函数。将void main更改为int main并在函数末尾返回零。
Correct: you have written it as void function. Change "void main" to "int main" and return zero at the end of the function.
prog.c:9:3: error: expected ‘;’ before ‘for’
for (i = 0; i < 4; i++)
所以看看你的代码:
So look at your code:
pa = a
for (i = 0; i < 4; i++)
这没错:两个命令之间的分号在哪里?
等等......
阅读邮件。想想他们说的话。
不要只是它不起作用或者你将无处可去 - 让它编译是很容易的!在那之后,你必须让它工作,这更难。
It's not wrong: where is the semicolon between the two commands?
And so forth...
Read the messages. Think about what they say.
Don't just go "it didn't work" or you will get nowhere - getting it to compile is the easy bit! After that, you have to get it to work, and that's a lot harder.
这篇关于指针和C的数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!