Ask your own question, for FREE!
Computer Science 21 Online
OpenStudy (myname):

can a char in c++ hold ctrl Z? char a = '?' ; how do i do this? Or can i say int b = 26; char a = char(26); i tried this but it diplays '->'

OpenStudy (myname):

Actually, i wanted the user to enter ctrl-Z. Then, i want to check if they entered ctrlZ. But, its not working.

OpenStudy (anonymous):

C++ does not read the control characters by default. Usually, they are sent to your terminal and not to the application (so that you can use Ctrl-C to kill your application if it hangs). You need to figure out how you can say to your system that you do want to accept all input (it's do-able, some libraries like ncurses can do it). How can you do that? I don't know, but it will depend on your system (Windows/Mac/Linux etc.).

OpenStudy (anonymous):

You can use TranslateMessage (WinAPI) or PreTranslateMessage (MFC) to check for the the proper key press. here is a list of the VK_ controls http://msdn.microsoft.com/en-us/library/dd375731%28VS.85%29.aspx

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!