回复 2楼 TonyDeng
把函數提到main前面了.還是一樣的錯誤.
g++.exe
-x c++ -c C:\Users\PC\Desktop\C\1 -o C:\Users\PC\Desktop\C\1.o
-Wall -fpermissive
-Wno-sign-compare -g
C:\Users\PC\Desktop\C\1:2: error: `n' was not declared in this scope
C:\Users\PC\Desktop\C\1:2: error: `m' was not declared in this scope
C:\Users\PC\Desktop\C\1: In function `int aaa(int, int)':
C:\Users\PC\Desktop\C\1:8: error: `a' undeclared (first use this function)
C:\Users\PC\Desktop\C\1:8: error: (Each undeclared identifier is reported only once for each function it appears in.)
C:\Users\PC\Desktop\C\1: In function `int main()':
C:\Users\PC\Desktop\C\1:13: error: `n' undeclared (first use this function)
C:\Users\PC\Desktop\C\1:13: error: `m' undeclared (first use this function)
C:\Users\PC\Desktop\C\1:19: error: `a' undeclared (first use this function)
C:\Users\PC\Desktop\C\1:13: error: too many arguments to function `int aaa(int, int)'
C:\Users\PC\Desktop\C\1:21: error: at this point in file
Failure
請問你,我變長數組寫錯了嗎?