LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-28-2011, 11:12 PM   #1
comp_brad1136
Member
 
Registered: Nov 2004
Location: SW Missouri, USA
Distribution: Debian 6 "Squeeze"
Posts: 55

Rep: Reputation: 7
trying to learn ncurses


This seems like such an easy thing to do, prompt for input that will be used as a number rather than a character.

can somebody please ncurses-ify line two of the following snippit?

Code:
float x;
cin >> x;
DoMathOn(x);
 
Old 03-29-2011, 07:26 AM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
ncurses uses C style IO:
Code:
float x;
scanw("%f", &x);
DoMathOn(x);
See curs_scanw(3x).
 
Old 03-29-2011, 07:58 AM   #3
wje_lq
Member
 
Registered: Sep 2007
Location: Mariposa
Distribution: FreeBSD,Debian wheezy
Posts: 811

Rep: Reputation: 179Reputation: 179
Of course, that isn't the whole story. Go here. Don't worry, it's written in English.
 
1 members found this post helpful.
Old 03-29-2011, 11:29 AM   #4
comp_brad1136
Member
 
Registered: Nov 2004
Location: SW Missouri, USA
Distribution: Debian 6 "Squeeze"
Posts: 55

Original Poster
Rep: Reputation: 7
thanks! with your tidbit, I was able to find "the rest of the story" at the link you posted and this one.
http://www.vectorsite.net/tscpp_3.html
 
Old 03-29-2011, 12:05 PM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
I'm glad you were able to find something useful the the 'A Little C Primer' site, but I would like to emphatically point out that that site is one of those DOS/Windows oriented C sites, which would have you believe that the likes of getch(), and kbhit() is something from standard C, which it is not. These forums are littered with threads that ask why 'standard C code' using these functions can't be compiled on Linux, or other POSIX platforms.

--- rod.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to print text in color by ncurses without opening a ncurses window Greatrebel Programming 0 12-20-2006 09:15 AM
qt vs ncurses nass Programming 1 06-08-2006 03:01 PM
Ncurses rem1986 Linux - Software 1 12-28-2005 12:38 PM
NCurses 4? gsibble Linux - Software 0 02-18-2004 02:31 AM
ncurses-5.2-28 conflicts with file from package ncurses-5.2-12 tubby Linux - Software 4 06-16-2002 12:00 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration