Page 417 - C++
P. 417

cin>>ans[i];
                     ans1[i][0]=toupper(ans[i]);
                     ans1[i][1]='\0';
                     ans[i]=toupper(ans[i]);
                     outtextxy(110+40*i,358,ans1[i]);
                  }
                  ans[i]='\0';
                  getch();
                  for(i=0;i<iff;i++)
                  {
                     if(strcmp(wstr[i],ans)==0)
                     {
                       temp++;
                     }
                  }
                  if(temp!=0)
                  {
                     score+=10;
                     congrats();
                  }
                  else
                  {
                     wrong();
                  }
                  cleardevice();
                  settextstyle(3,0,2);
                  outtextxy(200,200,"DO YOU WANT TO CONTINUE");
                  outtextxy(200,250,"    WITH THE GAME");
                  outtextxy(160,300," Y FOR YES          N FOR NO");
                  cin>>rep;
                  rep=toupper(rep);
                  if(rep=='N')
                  {  fstream sc;
                     sc.open("d:/nir/score.dat",ios::in|ios::out|ios::binary);
                     char sas[5], saa[5], sab[5], sac[5], sad[5], sae[5];
                     cleardevice();
                     sc.seekg(0,ios::beg);
                     sc.read((char*)&rr,sizeof(rr));
                     int p=sort();
                     sc.seekp(0,ios::beg);
                     sc.write((char*)&rr,sizeof(rr));
                     if(p==1)
                     {
                        outtextxy(10,50,"CONGRATS! YOU HAVE MADE IT ");
                        outtextxy(10,80,"  TO THE BOARD OF ELITES.");
                        delay(1000);
                     }
                     outtextxy(220,120,"SCORECARD:");
                     itoa(rr.h[0],saa,10);
                     itoa(rr.h[1],sab,10);
                     itoa(rr.h[2],sac,10);
                     itoa(rr.h[3],sad,10);
                     itoa(rr.h[4],sae,10);
                     itoa(score,sas,10);
   412   413   414   415   416   417   418   419   420   421   422