#include <stdio.h>
void readMatrix(int*a,int*b){
int r,c;
scanf("%d%d",&r,&c);
a = &r;
b = &c;
}
main(){
int a,b;
readMatrix(&a,&b);
printf("%d\n%d",a,b);
}
When i run it and insert values 1 and 2 and print the a,b variables in main 1697527160 and 1700556911. I know that i could simply scan the a,b values in main but what's the fault in my code?