Presumably MAC_ADRESSES
is not an array of pointers. NULL
is a pointer (normally (void *)0
in C), so you can’t assign it to a non-pointer variable.
Edit: Since your definition is char MAC_ADRESSES[MAX_LINES][100]
, you have a 2D array, not an array of pointers. You can’t store NULL
in this array. You can wipe out a string by putting a null character in the first byte, though:
MAC_ADRESSES[j][0] = '\0';
Note that you can’t test strings for equality using ==
, either. You should be using strcmp
.
solved Incompatible types in assignment. C [closed]