I wanted a suggestion regarding the following macro.
I have to check the existence of some element in a 2D array,
Which of the following would be the best way to write
1.) pass the array name, row and col
#define EXISTS_IN_ARRAY (A,R,C) (A[R][C]=='x')
2.) pass only the row and col
#define EXISTS_IN_ARRAY (R,C) (array[R][C]=='x')
3.) No arguments
#define EXISTS_IN_ARRAY (array[i][j]=='x')
--
Vyom
I have to check the existence of some element in a 2D array,
Which of the following would be the best way to write
1.) pass the array name, row and col
#define EXISTS_IN_ARRAY (A,R,C) (A[R][C]=='x')
2.) pass only the row and col
#define EXISTS_IN_ARRAY (R,C) (array[R][C]=='x')
3.) No arguments
#define EXISTS_IN_ARRAY (array[i][j]=='x')
--
Vyom
Comment