Having problems replacing data in array <p>For a project I have to do, I have to list a set of classes, have the user select which class to use, and print out a weekly schedule for them for the semester. (Same program as the first question I asked.) However, I seem to run into a problem when I try to print out a weekly schedule. (The program is pretty lengthy, at least with the experience I have in C.)</p> <pre><code>struct course { int index; char name[7]; char day[4]; int hours,houre,mins,mine; char ap[3]; int credit; }; struct course whcl[]={ {0,"MATH1","MWF",7,8,30,50,"AM",5}, {1,"MATH2","MWF",9,10,00,20,"AM",5}, {2,"CHEM1","MW ",2,6,30,50,"PM",5}, {3,"PHYS4","TTH",4,6,00,45,"PM",4}, {4,"ENGR1","M ",9,10,30,20,"AM",1}, {5,"ENGR2","TTH",10,12,00,15,"PM",3}, {6,"ENGR3","MW ",11,12,00,15,"PM",3}}; int choice[15],i,j,k,num,z,s; void printout(int z); //(To be put in when I fix the function) int main(void) { char l[8][3]={{"st"},{"nd"},{"rd"},{"th"},{"th"},{"th"},{"th"},{"th"}}; printf(" Fall Schedule\n"); printf("Index Course Day Time Credit\n"); printf("-------------------------------------------\n"); for(i=0;i&lt;7;i++) { printf(" %i %s %s %i%i:%i%i-%i%i:%i%i%s %i\n", whcl[i].index,whcl[i].name,whcl[i].day, whcl[i].hours/10,whcl[i].hours%10, whcl[i].mins/10,whcl[i].mins%10, whcl[i].houre/10,whcl[i].houre%10, whcl[i].mine/10,whcl[i].mine%10, whcl[i].ap,whcl[i].credit); } printf("How many classes would you like to take?: "); scanf("%i",&amp;num); for(i=0;i&lt;num;i++) { printf("Select the %i%s class using the index: ",i+1,l[i]); scanf("%i",&amp;choice[i]); } printf("The classes you have selected are:\n"); printf("Index Course Day Time Credit\n"); printf("-------------------------------------------\n"); for(i=0;i&lt;num;i++) { s=choice[i]; printf(" %i %s %s %i%i:%i%i-%i%i:%i%i%s %i\n", whcl[s].index,whcl[s].name,whcl[s].day, whcl[s].hours/10,whcl[s].hours%10, whcl[s].mins/10,whcl[s].mins%10, whcl[s].houre/10,whcl[s].houre%10, whcl[s].mine/10,whcl[s].mine%10, whcl[s].ap,whcl[s].credit); } printf("Your weekly schedule for Fall is:\n"); printf(" Time Monday Tuesday Wednesday Thursday Friday\n"); printout(z); return 0; } void printout(int z) { int start,starti,end,endi,num; int slot[25][6]; for(i=0;i&lt;24;i++) for(j=0;j&lt;5;j++) slot[i][j]=99; for(i=0;i&lt;num;i++) { if ((whcl[choice[i]].day)=="MWF")//I think the problem is here. { start=whcl[choice[i]].hours*60+whcl[choice[i]].mins; end=whcl[choice[i]].houre*60+whcl[choice[i]].mine; starti=(start-450)/30; endi=(end-450)/30; for(j=starti;j&lt;=endi;j++) slot[j][1]=slot[j][3]=slot[j][6]=whcl[choice[i]].index; } } for(i=0;i&lt;24;i++) { printf("%i%i:%i%i-%i%i:%i%i ", (450+(i-1)*30)/60/10,(450+(i-1)*30)/60%10, (450+(i-1)*30)%60/10,(450+(i-1)*30)%60%10, (450+(i-1)*30+30)/60/10,(450+(i-1)*30+30)/60%10, (450+(i-1)*30+30)%60/10,(450+(i-1)*30+30)%60%10); for(j=0;j&lt;4;j++) { if (slot[i][j]!=99) //Use Note here printf(" %s ",whcl[choice[i]].name); else printf(""); } printf("\n"); } return; } </code></pre> <p>When I print out the schedule, the only thing that comes up is the time. Everything else is blank. I think it's due to my trying to replace the slot array with something other than 99. If you plan on running this program, please use 2 the amount of classes you want to take, and use 0 and 1 for the index on the class choice. (I don't have any if statements and whatnot to take into account the other classes the user might have chosen.) Here's a photo of what I'm trying to do for my program. <a href="http://postimg.org/image/3tlgtwu9h/" rel="nofollow">http://postimg.org/image/3tlgtwu9h/</a> I used paint to put in the boxes on the schedule to visually see the different arrays as I was coding.</p> <p>Note: If you change the if statement to [i][j]==99 You can see the "Class" being printed on the table, however it fills up the entire array slot, which confirms my thought that I messed up on trying to replace data in the array. Also, I filled it up with 99 to make 99 associated with blank spaces.</p>