I have the following simple code in C:
void main()
{
int* s;
int a = 5, b = 3;
sum(a, b, s);
printf("%d + %d = %d", a, b, *s);
}
void sum(int a, int b, int* s) {
*s = a + b;
}
the program compiles, but gives a runtime error. Why?
Process returned -1073741819 (0xC0000005) execution time : 0.972 s Press any key to continue.