This code, as you know, has a good chance of crashing depending on where the temp pointer points to. My problem is to write a procedure that guarantees its crashing when run like this:Code:void swap (int *x, int *y) { int *temp; *temp = *x; *x = *y; *y = *temp; }
Any ideas?Code:int main () { int a = 1, b = 2; proc(/* Some args might go here */); swap(&a, &b); }