This part of my code:
char MAC_ADRESSES[MAX_LINES][100];
for(j=i+1; j<=countlines; j++)
{
if((MAC_ADRESSES[j])==(MAC_ADRESSES[i]))
{
MAC_ADRESSES[j] = NULL;
}
At the point where I want to change the string with a NULL I have a compiler error about incompatible types assignment. Do not understand why..
Presumably
MAC_ADRESSESis not an array of pointers.NULLis a pointer (normally(void *)0in 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 storeNULLin this array. You can wipe out a string by putting a null character in the first byte, though:Note that you can't test strings for equality using
==, either. You should be usingstrcmp.