ArrowKeys - case 'P':

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <iostream.h> #include <conio.h> # main() { char ch; ch = getche(); while (ch != 13) { switch(ch) { case 'a': break; case 'i': break; case 0: //arrow key. .. ch = getch(); switch (ch) { case 'H' : cout<<"UP"<<endl; break;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: case 'P': cout&lt;&lt;&quot;Down&quot;&lt;&lt;endl; break; case 'M': cout&lt;&lt;&quot;Right&quot;&lt;&lt;endl; break; case 'K': cout&lt;&lt;&quot;Left&quot;&lt;&lt;endl; break; default: cout&lt;&lt;int(ch); } } ch = getche(); } }...
View Full Document

Ask a homework question - tutors are online