I have the following code :
typedef enum {Z,O,T} num;
bool toInt (str s,int& n);//<-if convert is possible converts s to integer ,puts the result in n and returns true,else returns false
I want to use toInt function and transfer as a second argument ,argument of type num
num n;
toInt("2",n);
This causes compilation error.
cannot convert parameter 2 from 'num' to 'int &'
I tried to use a cast : toInt("2",(num)n); But it is still problematic
How can I solve the issue?