bill@uoregon.UUCP (bill) (10/15/84)
[this line intentionally left blank]
For those who are amused by C quirks:
While attempting to fix a program bug, I changed the code from
arragement A to arrangement B (below).
--- A ---
char strings[SIZE1][SIZE2];
teststr(str)
char *str;
{
register char (*b)[SIZE2] = strings;
while (b < &strings[SIZE1]) {
if (strcmp(str, b) == 0)
break;
b++;
.
.
.
}
--- B ---
char strings[SIZE1][SIZE2];
teststr(str)
char *str;
{
register char (*b)[SIZE2] = strings;
while (b < &strings[SIZE1]) {
if (strcmp(str, *b) == 0)
break;
b++;
.
.
.
}
The result, of course, is that nothing changes.
Randy Goodall, Perfect Software, Inc. (courtesy bill)
{tektronix,hpcvra,hp-pcd}!uoregon!bill
/* ---------- */