OK Green > start 1
OK Green > start 2
No Green > start 3
OK orange > start 1
No orange > start 2
No orange > start 3
OK red > start 1
OK red > start 2
OK red > start 3
I put each them in a array of strings called permitted group[9][5] defined globally the function readfile works fine as below.
Now the question is how can you do a function to check(I already tried !)
if(first value in the Permit_group1=="OK") &&
if(the second value in the Permit_group1=="str") && str: as in the parameters
if(the fifth value in the Permit_group1=="id") id: as in the parameters
?? how can I do that for all the 9 rows of the array
lets say I called check(1, green)
1 2 3 4 5 6 7 8 9 10 11 12 13 14
bool check(int id, string str){
int i=0;
bool found =false;
while (i < 9 && !found){
if ((Permit_group1[i][1]==str) && (Permit_group1[i][0]=="OK") && (id== Permit_group1[i][4])){
return permit;
found=true;
}
i++;
}
return deny;
}