I must have tried 20 ways of doing this by now. I really need help, no matter what I do i get a error similar to this one.
a value of type \"int\" cannot be
I have a note for rendon's answer:
For his code, Visual C++ says for every "=" operations: error C2440: '=' : cannot convert from 'void *' to 'int **'
By making some changes, it works for me, but I'm not sure that it does the same, so I afraid of editing his code. Instead, here's me code, that seems to work for a first impression.
int **a;
a = (int **)malloc(rows * sizeof(int));
for (i = 0; i < rows; i++)
{
a[i] = (int *)malloc(cols * sizeof(int));
}
for (j=0;j
Actually, I did it with a custom struct
instead of int
s but I think either way should it work.