I'm in the late stages of a c program that is a dynamic word search. I get the "warning: assignment makes integer from pointer without a cast [enabled by default]" when I compile these lines:
**grid = gridReal;
**items = itemsReal;
**solution = solutionReal;
My main up to that point looks like this:
int main()
{
char gridReal[50][50];/*Array to hold puzzle*/
char itemsReal[100][50];/*Array to hold words*/
char solutionReal[50][50];/*Array to hold solution*/
int dimension;/*Width and height*/
int x, y;/*Counters for printing*/
char** grid = (char**)malloc(sizeof(char)*100*50);
char** items = (char**)malloc(sizeof(char)*100*50);
char** solution = (char**)malloc(sizeof(char)*100*50);
**grid = gridReal;
**items = itemsReal;
**solution = solutionReal;
Any ideas on how to sort this out?
**gridis of typechar, you are trying to assign achar (*)[50](the type to whichgridRealdecays). Obviously, it won't compile. What are you trying to achieve with these assignments?=operator in C, and you haven't initialized them anyway. If you're just trying to assign the address of the array to your pointers, why are you doing all thosemalloc()s and throwing your references away?char gridReal[50][50]creates the space. Calling malloc again and then an assignment to grid is odd....