I'm trying to use the switch function to compute the resistance of resistors. Basically, a person types in 3 letters, each representing a color; each color has a different value. Then v throws back the resistance by going through the equation. This is what I have so far.
#include <iostream>
#include <cmath>
using namespace std;
int calcRval(int,int,int);
int c1,c2,c3,val,colCode;
int main(){
char c1,c2,c3;
cout<<"input c1:";cin>>c1;
cout<<"input c2:";cin>>c2;
cout<<"input c3:";cin>>c3;
val=calcRval(c1,c2,c3);
}
int calcRval(int c1,int c2, int c3){
int v1,v2,v3,v;
v1=colCode(c1);
v2=colCode(c2);
v3=colCode(c3);
v=(10*v1+v2)*double pow(10,v3);
return v;
}
switch(colCode){
case 'B':0;break;
case 'N':1;break;
case 'R':2;break;
case 'O':3;break;
case 'Y':4;break;
case 'G':5;break;
case 'E':6;break;
case 'V':7;break;
case 'A':8;break;
case 'W':9;break;
}
The problems it has is that it says pow is an ambiguous call to overloaded function and that the v1,v2 and v3 terms do not evaluate to a function taking 1 arguments. I have no idea what any of this means, and i cant find it in my book. I also cannot figure out why my switch will not activate.
Please help, and keep in mind that I am a total beginner.