This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

syntax of 'c' language

Hello;
I m implementing the 4x4 matrix keypad logic.
I m using a logic of columns and rows. 4 lines of port are used as rows and other 4 lines are column. If port 1 is used then p1.0 to p1.3 = rows. P1.4 to p1.7 = columns.
I check for the key press making one row low.
If I find any column low in particular row then I break the loop and returns the matrix I have made for the key press
I check for the key press in if loop. And then I break the if loop and come to ‘returning of matrix element logic’ which is present in the same function.
Since I can not come out of ‘if’ using break, so I hav used ‘goto LABEL’, to come to ‘returning of matrix logic’
Is it OK to used goto in microcontroller programming?
My code is working.

0