gcc warning: assignment makes integer from pointer without a cast
c, gcc, pointers, warnings
Solution
NULL is not a valid integer, and it is being assigned to an entry of an array made up of presumably `int`s, so the compiler is complaining.
NULL is used as a default pointer value that indicates "nothing" .. if you had a pointer variable and assigned NULL to it, you'd be saying that pointer variable points to "nothing".
Because of this type mismatch, the specific message is warning you that you are trying to assign one type (really a pointer value) to another (`int`) without trying to cast it (which is how we sometimes convert one type to another in order to avoid type mismatches).
If you had an array of pointers this assignment of NULL would be perfectly ok.
Problem
I am making this assignment in my program and I am getting the warning a titled. Here is the code snippet: `table_name[index] = NULL;` I could not understand what can be a problem in such a statement.