473,738 Members | 5,934 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to non-stop read the input character and without user press enter in console mode.

hi here is my original// it can convert to upper case or lower case but
require user press "enter" how to implement a without "press enter" version
e.g. if input 'a' --> at commad prompt will show 'A' immediately
if read '(' it will end.

int main()
{
char input;
//char input1[1];
cout<<"Please Enter As mush as you can:";
do {
cin.get(input);
//cin.putback(inp ut);
if (isupper(input) )
cout.put(tolowe r(input));
else
cout.put(touppe r(input));

}while (input != '(');
cout << endl; // ensure all output is displayed
return 0;
} // end main
Jul 22 '05 #1
4 2176
On Thu, 15 Jan 2004 19:10:12 +0800, penny336 wrote:
hi here is my original// it can convert to upper case or lower case but
require user press "enter" how to implement a without "press enter" version
e.g. if input 'a' --> at commad prompt will show 'A' immediately
if read '(' it will end.


http://www.parashift.com/c++-faq-lit...html#faq-15.17

Jul 22 '05 #2
hih Simon,

could u post the code here...
because the link of code is dead
http://ccwf.cc.utexas.edu/~apoc/programs/c/kbhit.c

Jul 22 '05 #3
penny336 wrote:

hih Simon,

could u post the code here...
because the link of code is dead
http://ccwf.cc.utexas.edu/~apoc/programs/c/kbhit.c


Better. Learn to use the resources at your
fingertips. It's all somwhere out there, you
just need to find it.

http://www.google.com

for the search field enter: UNIX kbhit

The first search result looks like a 100% hit.

--
Karl Heinz Buchegger
kb******@gascad .at
Jul 22 '05 #4
Karl Heinz Buchegger writes:
Better. Learn to use the resources at your
fingertips. It's all somwhere out there, you
just need to find it.

http://www.google.com

for the search field enter: UNIX kbhit

The first search result looks like a 100% hit.


And it only took two magic words! :-)
Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
4424
by: lothar | last post by:
re: 4.2.1 Regular Expression Syntax http://docs.python.org/lib/re-syntax.html *?, +?, ?? Adding "?" after the qualifier makes it perform the match in non-greedy or minimal fashion; as few characters as possible will be matched. the regular expression module fails to perform non-greedy matches as described in the documentation: more than "as few characters as possible"
17
3273
by: cheeser | last post by:
Hello all, Please see the question in the code below... Thanks! Dave #include <iostream>
5
3752
by: klaus triendl | last post by:
hi, recently i discovered a memory leak in our code; after some investigation i could reduce it to the following problem: return objects of functions are handled as temporary objects, hence their dtor is called immediately and not at the end of the function. to be able to use return objects (to avoid copying) i often assign them to a const reference. now, casting a const return object from a function to a non-const reference to this...
2
2592
by: Mark Stijnman | last post by:
I would like to be able to have an object accessible as a vector using the operator, but able to track modifications to its data, so that it can update other internal data as needed. I figured that setting a flag in the non-const operator would work, but it doesn't. Take the code below: #include <iostream> using std::cout; using std::cerr;
1
6904
by: Markus Ernst | last post by:
Hi I wrote a function that "normalizes" strings for use in URLs in a UTF-8 encoded content administration application. After having removed the accents from latin characters I try to remove all non-word characters from the string: // PCRE syntax: $string = preg_replace("/(+)/", "-", $string);
25
7631
by: Yves Glodt | last post by:
Hello, if I do this: for row in sqlsth: ________pkcolumns.append(row.strip()) ________etc without a prior:
22
12045
by: Steve - DND | last post by:
We're currently doing some tests to determine the performance of static vs non-static functions, and we're coming up with some odd(in our opinion) results. We used a very simple setup. One class had a static function, and the one class had a non-static function. Both of these functions did the exact same thing. The test function: public void Test(){ decimal y = 2; decimal x = 3;
2
6114
by: Ian825 | last post by:
I need help writing a function for a program that is based upon the various operations of a matrix and I keep getting a "non-aggregate type" error. My guess is that I need to dereference my pointers, but I'm not sure. Please help. The code: void equate(matrix *A, matrix *B) { int i, j; assert(A.row_dim == B.col_dim && A.col_dim == B.col_dim); for(i=0; i < A.row_dim; i++) for(j=0; j < A.col_dim; j++)
399
12877
by: =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= | last post by:
PEP 1 specifies that PEP authors need to collect feedback from the community. As the author of PEP 3131, I'd like to encourage comments to the PEP included below, either here (comp.lang.python), or to python-3000@python.org In summary, this PEP proposes to allow non-ASCII letters as identifiers in Python. If the PEP is accepted, the following identifiers would also become valid as class, function, or variable names: Löffelstiel,...
13
18951
by: asm23 | last post by:
Hi,I need some help to clarify the warning "initial value of reference to non-const must be an lvalue". I'm searching in this groups to find someone has the same situation like me. I found in the Post: http://groups.google.com/group/comp.lang.c++/browse_thread/thread/e81cd9d9c2200d74/48c0774eeb3bd998?hl=en&lnk=gst&q=initial+value+of+reference+to+non-const#48c0774eeb3bd998 ...
0
8788
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9476
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9335
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6751
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4825
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3279
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.