I am working on c # but I need to verify if a void type meets a condition to follow instructions but I don't know how to do it, I was trying to do it with an if in the following way but it gives me error someone could help me :(
if ((lex.addtoken(analisis.Type.Words_Reserved_Planificador) ==
true)&&(lex.addtoken(analisis.Type.Symbol_Two_Points)==true))
{
instruccions
}else{
Console.WriteLIne("Error :(");
}
Please find the following explanation on the given query.
Answer:
When you want to verify whether the function return has any value is, what you can do is simply use "if ((lex.addtoken(analisis.Type.Words_Reserved_Planificador))&&(lex.addtoken(analisis.Type.Symbol_Two_Points)))" by removing true as the return type.
In this case what ever the return type, other than void, it will execute the instructions from if block.
In case of void or 0, it will execute the else block..
if
((lex.addtoken(analisis.Type.Words_Reserved_Planificador))&&(lex.addtoken(analisis.Type.Symbol_Two_Points)))
{
instruccions
}else{
Console.WriteLIne("Error :(");
}
Note: Please provide us the complete program to fix the issues because we didnt get the source code for the program
Get Answers For Free
Most questions answered within 1 hours.