/* Menu Shower V 1.0 Compile with visual c++ 6 Programmer:Milad Kakoli(Kitten) E-main:hellcrueldictator@yahoo.com Weblog:www.kitten.mihanblog.com yek code besyar sade baraye nemayesh yek menu sade ke omidvaram dafa'at bad betonam ziba tar va karamad taresh konam. in code ghabliat shenakht jahhat haye bala va paiine baraye moshakhas kardan gozine entekhab shode ra darad va ba zadan enter halghe payan yafte gozine entekhab shode moshakhas mishavad baraye etela'at bishtar be weblog moraje'e konid. */ #include #include #include #include #include int ch; //braye gereftan jahat int row=0; //moshakhas kardan satr fa'al #define MAX 40 // bishtarin tedad char moton char uptext[1][MAX]; // matne balaye menu bool chi=true; struct Student { int tedad; // tedad gozinehaye ghabel entekhab char moton[5][MAX]; // moton gozinehaye ghabel entekhab };Student s; /*tabe menu ke moton menu ra print mikonad*/ int menu() { cout<< uptext[0]<>ejraye tabe menu ch =getch(); //up=72,down=80, enter=13 switch(ch) { case 72://up if (row==0) { row=s.tedad-1; }//bargardandan be paiin else { row=row-1; }//bargardandan be bala break; case 80://down if(row==s.tedad-1) { row=0; }//bargardandan be bala else { row=row+1; }//bargardandan be paiin break; case 13://enter chi=false;//baraye khoroj az halghe break; } } /*baraye anjam karhaye badi gozineye entekhab shode tavasot karbar row+1 ast */ return 0; }