Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

C programming - char input

Name: Anonymous 2008-08-28 19:15

Hi guys, I'm tired as shit, but trying to finish part of the C assignment I have... The problem is this: I need to read input from keyboard, only one character at a time, but without waiting for user to press enter.
Program is drawing an ascii box on screen with '+' inside, and based on the user input program moves it in desired direction... the only problem is that user needs to press enter after each input :)
I'm tired as hell and off to sleep soon, but I'm affraid it will keep bugging me so I won't be able to sleep and will instead go research streams... and that would not be a good choice for me currently, so - many internets to anyone who helps :))
Sorry for my bad english...

Name: Anonymous 2008-08-28 19:17

Forget it, it's NP-complete.

Name: ಠ_ಠ 2008-08-28 19:19

many internets to anyone who helps :))
Return to /b/,please.

Name: Anonymous 2008-08-28 19:21

OP here, found it... getche() function :)
It's unbuffered (doesn't wait for newline) and echoing (echoes every character directly on stdout)...
It's deprecated, old, but it works for now... hah! Off to sleep now.

Name: Anonymous 2008-08-28 19:22

Use ncurses. It has a getch function that isn't line buffered. I believe you have to let ncurses know that you want this by calling the cbreak function.

Name: Anonymous 2008-08-28 21:42

Use [b][u][o][i]ENTERPRISE[/i][/o][/u][/b]. It has a [b][u][o][i]CUSTOMER-ORIENTED SCALABLE TURKEY getCh[/i][/o][/u][/b] solution that isn't line buffered. I believe you have to let [b][u][o][i]ENTERPRISE[/i][/o][/u][/b] know that you want this by calling the [b][u][o][i]EXPERT CUSTOMIZABLE DEMAND-DRIVEN DISTRIBUTED WEB SERVICE ORIENTED cBreak[/i][/o][/u][/b] function.

Name: Anonymous 2008-08-28 21:44

>>6
Wait I'm fixing it.

Use ENTERPRISE. It has a CUSTOMER-ORIENTED SCALABLE TURKEY getCh solution that isn't line buffered. I believe you have to let ENTERPRISE know that you want this by calling the EXPERT CUSTOMIZABLE DEMAND-DRIVEN DISTRIBUTED WEB SERVICE ORIENTED cBreak function.

Name: Anonymous 2008-08-28 21:58

Obviously the expedited retrieval of key business information from the console for improved customer satisfaction is a highly-demanded solution in today's customer-facing applications. You should formulate a strategy going forward to enrich your learns in order to gather the momentum to most effectively facilitate and leverage the synergies between turnkey business-ready solutions such as ncurses and the terminal emulator, followed by employing the cbreak pattern to deoperationalize the line-buffering service. That's how I'd go about it, anyway.

Name: Anonymous 2008-08-29 0:35

>>6,7

Fuck you dikes. Just trying to help my fellow programmer out, and here you are being bitches.

Name: Anonymous 2008-08-29 3:27

OP here, just woke up... lol :)
Thanks for ncurses suggestion!

Name: Anonymous 2008-08-29 8:29

>>8
Was that generated by an automated english to ENTERPRISE-speak translator? If so, would you care to share the source with /prog/?

Name: Anonymous 2010-12-17 1:40

Erika once told me that Xarn is a bad boyfriend

Don't change these.
Name: Email:
Entire Thread Thread List