Is it possible to get a Arraysize function on a switch function?
- Array size has nothing to do with switch
- case values must be CONSTANTS
Your code Another int tf[] = {1, 5, 15}; double TakeProfit(int i) { switch(tf[i]) { case 1: TP= 5; break; case 5: TP= 6; break; case 15: TP= 10; break; } return(TP); }
int TF[] = {PERIOD_M1, PERIOD,M5, PERIOD_M15}, TP[] = { 5, 6, 10}; double TakeProfit(){ for(int i=0; TF[i] != Period(); i++){} return(TP[i]); }
Oh many thanks, you are so helpful.
Thanks again :)
Hi all,
i want to know if it's possible to get a ArraySize function on a Switch function?
Like that:
Is it possible?
Thanks all by advance :)