Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!samsung!caen!b-tech!ais.org!garath From: garath@ais.org (Belgarath) Newsgroups: comp.lang.c Subject: name printing Message-ID: <47T+V4$@irie.ais.org> Date: 18 Jan 91 01:58:04 GMT Sender: garath@ais.org Organization: UMCC, Ann Arbor, MI Lines: 21 I have the following lines in a program that get no errors, but do not run the way I would like. This is on Turbo C for an IBM: main() { static char *days[7] = {"Saturday","Sunday",etc....}; int day_of_the_week; /* day of the week is evaluated to a number between 0 and 6 here */ then: printf("The day of the week is %s", days[day_of_the_week]); } Obviously all the calculations are cut out, but when it prints it either prints "The day of the week is (null)" or it prints all kinds of graphic characters. I even made it %c for a second in desperation (but changed back to %s) Please respond through e-mail, thanks. -- *------------------------------------------------------------------* | Scott | The University of Michigan, Ann Arbor | | garath@ais.org | Computer Science Major | *------------------------------------------------------------------*