![]() |
|< 1 2 >| | ![]() |
13 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
> cat test.cpp && g++ test.cpp
#include <stdio.h>
void print_array (int[] a) {
int laenge = sizeof(a) / sizeof(int);
for (int i=0;i<laenge;i++) {
printf("%d\n",a[i]);
}
}
int main () {
int a[2] = {1,2};
print_array(a);
return 0;
}
test.cpp:2: error: parse error before `)' token
test.cpp: In function `void print_array(...)':
test.cpp:3: error: `a' undeclared (first use this function)
test.cpp:3: error: (Each undeclared identifier is reported only once for each
function it appears in.)
int a[2] = {1,2};
![]() |
|< 1 2 >| | ![]() |
13 Einträge, 2 Seiten |