Mail Archives: djgpp/1995/12/12/10:04:26
aue AT u DOT washington DOT edu (A. Aue) writes:
> Help! I'm having a really strange problem with the bridge program I'm
> writing under djgpp. . . .
...
> for (n=1; n<=13; ++n)
> printf("South %d west %d north %d east %d\n", hands[1].cards[n], hands[2].ca
> printf("end main.");
...
The problem is in this and your other for loops. In C (and C++)
arrays are indexed from 0, not from 1. An array of three elements
have indexes 0, 1, and 2. You should change your for loops to read
for (n = 0; n < 13; ++n)
...
(There may be other problems with your program; I stopped looking when
I found this.)
Erik Max Francis, &tSftDotIotE && uuwest!alcyone!max, max AT alcyone DOT darkside DOT com
San Jose, California, U.S.A. && 37 20 07 N 121 53 38 W && the 4th R is respect
H.3`S,3,P,3$S,#$Q,C`Q,3,P,3$S,#$Q,3`Q,3,P,C$Q,#(Q.#`-"C`- && 1love && folasade
_Omnia quia sunt, lumina sunt._ && GIGO Omega Psi && http://www.spies.com/max/
"The Creator Raven looked at Man and was . . . surprised to find that this
strange new being was so much like himself." -- Eskimo creation myth
- Raw text -