Reading the space bar as a charcter in Dev-C++

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2007
Posts: 65
Reputation: CodeBoy101 is an unknown quantity at this point 
Solved Threads: 0
CodeBoy101's Avatar
CodeBoy101 CodeBoy101 is offline Offline
Junior Poster in Training

Reading the space bar as a charcter in Dev-C++

 
0
  #1
May 1st, 2008
Hello to all, I need to know how to read the space bar as a character (or string) rather than as a separator, and I also need to know if the same can be done with the enter key. I am grateful for all contributions.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,707
Reputation: Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all 
Solved Threads: 275
Lerner Lerner is offline Offline
Posting Virtuoso

Re: Reading the space bar as a charcter in Dev-C++

 
0
  #2
May 1st, 2008
look up the various versions of getline(). There's one for C style strings and another for STL string objects.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 2,462
Reputation: zandiago is on a distinguished road 
Solved Threads: 25
Featured Poster
zandiago's Avatar
zandiago zandiago is offline Offline
Nearly a Posting Maven

Re: Reading the space bar as a charcter in Dev-C++

 
0
  #3
May 1st, 2008
  1. Entering a keypress without pressing <Enter>
  2.  
  3. The following header must be added to the template:
  4. #include <conio.h>
  5.  
  6. if one wants to continue keypresses until the ampersand (&) is pressed.
  7.  
  8. while((targetletter = getch()) != '&')

Hope this helps..would be a good idea to post your assignment. The above is not the answer to your question...but you should be able to formulate your answer from the above info.
I shot the sheriff....but I didn't shoot the deputy
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC