Home » Archimedes archive » Acorn User » AU 1994-Xmas.adf » Programs » C/c/HangIt

C/c/HangIt

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1994-Xmas.adf » Programs
Filename: C/c/HangIt
Read OK:
File size: 0111 bytes
Load address: 0000
Exec address: 0000
File contents
/* Hang - should hang the machine. */

#include <stdio.h>

main()
{ int bucket[10];
  int i;

  printf("Bucket starts at %d ",(int) bucket);
  printf("and i's address is %d\n\n",(int) &i);
  for (i=0; i<=10; i++)
  { bucket[i] = 0;
    printf("Value of i is %d\n",i);
  }
}
00000000  2f 2a 20 48 61 6e 67 20  2d 20 73 68 6f 75 6c 64  |/* Hang - should|
00000010  20 68 61 6e 67 20 74 68  65 20 6d 61 63 68 69 6e  | hang the machin|
00000020  65 2e 20 2a 2f 0a 0a 23  69 6e 63 6c 75 64 65 20  |e. */..#include |
00000030  3c 73 74 64 69 6f 2e 68  3e 0a 0a 6d 61 69 6e 28  |<stdio.h>..main(|
00000040  29 0a 7b 20 69 6e 74 20  62 75 63 6b 65 74 5b 31  |).{ int bucket[1|
00000050  30 5d 3b 0a 20 20 69 6e  74 20 69 3b 0a 0a 20 20  |0];.  int i;..  |
00000060  70 72 69 6e 74 66 28 22  42 75 63 6b 65 74 20 73  |printf("Bucket s|
00000070  74 61 72 74 73 20 61 74  20 25 64 20 22 2c 28 69  |tarts at %d ",(i|
00000080  6e 74 29 20 62 75 63 6b  65 74 29 3b 0a 20 20 70  |nt) bucket);.  p|
00000090  72 69 6e 74 66 28 22 61  6e 64 20 69 27 73 20 61  |rintf("and i's a|
000000a0  64 64 72 65 73 73 20 69  73 20 25 64 5c 6e 5c 6e  |ddress is %d\n\n|
000000b0  22 2c 28 69 6e 74 29 20  26 69 29 3b 0a 20 20 66  |",(int) &i);.  f|
000000c0  6f 72 20 28 69 3d 30 3b  20 69 3c 3d 31 30 3b 20  |or (i=0; i<=10; |
000000d0  69 2b 2b 29 0a 20 20 7b  20 62 75 63 6b 65 74 5b  |i++).  { bucket[|
000000e0  69 5d 20 3d 20 30 3b 0a  20 20 20 20 70 72 69 6e  |i] = 0;.    prin|
000000f0  74 66 28 22 56 61 6c 75  65 20 6f 66 20 69 20 69  |tf("Value of i i|
00000100  73 20 25 64 5c 6e 22 2c  69 29 3b 0a 20 20 7d 0a  |s %d\n",i);.  }.|
00000110  7d                                                |}|
00000111