- Liittynyt
- 20.10.2016
- Viestejä
- 791
Olisiko jotakin paksumpaa rautalankaa, kun ei tämä oikein tästä ... vaikea korjata kun ei tajua miten ja miksi ja mitä se valittaa ...
Koodi:
$ cat positive.c
#include <complex.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
static void run(int argc, char *argv[]) {
double imin = 2;
int aaa = atoi(argv[1]);
int bbb = atoi(argv[2]);
int ccc = atoi(argv[3]);
int ddd = atoi(argv[4]);
int nnn = atoi(argv[5]);
int a = aaa;
for (int b = bbb; b <= nmax; b++) {
for (int c = ccc; c <= nmax; c++)
for (int d = ddd; d <= nmax; d++) {
const double complex x = a + I * b;
const double complex y = c + I * d;
printf( ... poistettu
}
}
}
}
int main() {
run(nnn);
return EXIT_SUCCESS;
}
$ gcc -o fuck positive.c
positive.c: In function ‘run’:
positive.c:14:27: error: ‘nmax’ undeclared (first use in this function); did you mean ‘fma
’?
14 | for (int b = bbb; b <= nmax; b++) {
| ^~~~
| fmax
positive.c:14:27: note: each undeclared identifier is reported only once for each function it appears in
positive.c: In function ‘main’:
positive.c:30:8: error: ‘nnn’ undeclared (first use in this function); did you mean ‘nan’?
30 | run(nnn);
| ^~~
| nan
positive.c:30:4: error: too few arguments to function ‘run’
30 | run(nnn);
| ^~~
positive.c:6:13: note: declared here
6 | static void run(int argc, char *argv[]) {
| ^~~