dont know where the prob,please tell me

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>


void MatrixA(long m,long n);

void Matrix(long m,long n,long i,long j);

int main()
{
char chAuswahl;
long a=0,b=0,c[5][5],d[5][5];
long i=0,j=0,k=0,m=0,n=0,o=0,p=0;

printf("A => Matrix A eingeben\n");
printf("B => Matrix B eingeben\n");
printf("M => Berechne AB und Ausgabe\n");
printf("T => Transporniere B und Ausgabe\n");
printf("==============================\n");
printf("E => Ende\n\n");
fflush(stdin);
printf("Auswahl: ");
scanf("%c",&chAuswahl);

switch(chAuswahl)
{
case 'A':
case 'a':
{
MatrixA(m,n);
break;
}

case 'B':
case 'b':
{
break;
}

case 'M':
case 'm':
{
break;
}

case 'T':
case 't':
{
break;
}

case 'E':
case 'e':
{
exit(1);
}

default:
{
system("CLS");
main();
break;
}
}

fflush(stdin);
_getch();
}

void MatrixA(long m,long n)
{
system("CLS");
printf("Zeile Matrix A: ");
scanf("%d",m);
printf("Spalte Matrix A: ");
scanf("%d",n);
main();

}
void Matrix(long m,long n,long i,long j)
{ for (i=0;i<m;i++)
{for (j=0;j<n;j++)
{printf("Element Matrix A ([%d],[%d]): ",i+1,j+1);
scanf("%d",&i);}
}


}

when i debug and it goes ok but when i click enter to enter the value for ((Spalte Matrix A:))..this came out ""Unhandled exception at 0x0fbde42e (msvcr100d.dll) in binu1400-Testat3.exe: 0xC0000005: Access violation writing location 0x00000000.""(error message)
scanf("%d",m); It expects pointer to value, not the value itself.

Also calling main (in default branch) is illegal.
Topic archived. No new replies allowed.