Ask your own question, for FREE!
Computer Science 23 Online
OpenStudy (anonymous):

Programming in C Create an array of pointers that points to the names of the days of the week. Display the days using a loop. So Far I have ( see below) but it fails #include int main() { char *DaysOW[] = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday","Sunday" }; int x; for(x=0;x<7;x+); printf("%s\n",DaysOW[x]); return(0); }

OpenStudy (rsmith6559):

I copied your code, correcting one error that I saw, and it worked fine. The error that I corrected, which I would expect the compiler would have caught, was in the for statement: for( x = 0; x < 7; x+ ) /* should be x++ */ Computers don't do what you want, they do exactly what you tell them. Little stinkers!

OpenStudy (anonymous):

@rsmith6559 thank you for your help!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!