Problem with changing variables :pointers, functions
Hi everyone, I'm trying to use a function and pointers to change 2 variables from nothing to whatever I scan in, When I compile the following code I get this:
Warning: Assignment makes pointer from integer without a cast
it happens at the *a = c; and *b = d; lines in the code below
any help is apreciated
Code:
Code:
include <stdio.h>
void scan(int **a, int **b)
{
int c, d;
printf("Enter the size of matrix 1: ");
scanf("%d %d", &c, &d);
*a = c;
*b = d;
}
main()
{
int *row, *col;
scan(&row, &col);
printf("%d %d, row, col);
}