Ik ben nu al twee uur aan het knoeien om een syntax error uit mijn code te krijgen. Het lukt voor geen meter. Misschien zou iemand even met mij mee willen kijken.
De compiler zegt dat hij op regel 48 een ) mist
De compiler zegt dat hij op regel 48 een ) mist
C:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
| /* INCLUDES: */ #include <stdio.h> #include <math.h> /* DEFINES: */ #define Tmax 400 #define Ymax 26 #define Xmax 50 /* FUNCTION DECLARATIONS: */ float input(void); float berekenX(float,float,float,float); float berekenY(float,float,float,float); /* MAINPROGRAM: */ int main() { char lissajou[Ymax][Xmax]; float stapGrote, t, p, q; printf("Geef de waarde van de stapgrote \n"); stapGrote = input(); printf("Geef de waarde van p \n"); p = input(); printf("Geef de waarde van q \n"); q = input(); for(t = 0; t <= Tmax; t = t + stapGrote){ float X, Y; X = berekenX(Xmax, Tmax, p, t); Y = berekenY(Ymax, Tmax, q, t); lissajou[Y][X] = '*'; } return 0; } float input(void) { float waarde; scanf("%f", &waarde); return waarde; } float berekenX(float Ymax, float Tmax, float p, float t){ float w, x; w = (2 * M_PI) / Tmax; x = (Xmax / 2) * ( 1 + sin(p * w * t)); return x; } float berekenY(float Ymax, float Tmax, float q, float t){ float w, y; w = (2 * M_PI) / Tmax; y = (Ymax / 2) * (1 + sin(q * w * t)); return y; } |