ultimate14
Gebruiker
- Lid geworden
- 10 nov 2009
- Berichten
- 13
Dit is mijn code.
Ik snap niet hoe ik de fout op kan lossen.
subscripted value is neither array nor pointer
de fout hoort bij de regel onder beide for-lussen.
Ik hoop dat iemand kan helpen!
Ik snap niet hoe ik de fout op kan lossen.

subscripted value is neither array nor pointer
de fout hoort bij de regel onder beide for-lussen.
Code:
#include <stdio.h>
#include <conio.h>
#define C_MAX 3
#define R_MAX 5
float toonrc(float, float, float, float, float);
int main(void){
float capaciteit;
float weerstand;
float RC;
float c_tjes[C_MAX]= {1.2e-6, 2.5e-6, 8.9e-4},
r_tjes[R_MAX]= {2.23e3, 2.5e3, 2.71e3, 2.7e3, 4.7e4};
toonrc(c_tjes[C_MAX], r_tjes[R_MAX], RC, capaciteit, weerstand);
getch();
}
float toonrc(float c_tjes, float r_tjes, float RC, float capaciteit, float weerstand){
int a;
int b;
for(a = 1; a <= 3; a++){
capaciteit = c_tjes[a];
for(b = 1; b <= 5; b++){
weerstand = r_tjes[b];
RC = capaciteit * weerstand;
printf("C = %f(F) R = %f(Ohm) -> RC = %f(sec)\n", capaciteit, weerstand, RC);
}}}
Ik hoop dat iemand kan helpen!