Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: Can I detect "enter" key using scanf?

Reply
Thread Tools

Re: Can I detect "enter" key using scanf?

 
 
Ben Pfaff
Guest
Posts: n/a
 
      08-05-2003
(Abby) writes:

> I would like to detect if user type nothing and just press enter, my
> program will assign "toyota" as the default value. With above code,
> when I press enter with NULL value, the program will go no where. It
> still waiting for me to type something. How can I get through this?


Use fgets().
--
"...what folly I commit, I dedicate to you."
--William Shakespeare, _Troilus and Cressida_
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent: How can I get the enter key to behave like a tab key? Karen Grube ASP .Net Web Controls 3 11-29-2004 03:23 PM
QuickBooks Key v6.5.918 WinALL, Quicken Key v6.5.918 WinALL, Peachtree Accounting Key v6.5.971 WinALL, new ! code_fu NZ Computing 0 10-10-2004 02:26 PM
Replace Tab Key to Return Key (Enter Key) from Web Forms? M P ASP General 1 08-06-2004 08:32 AM
Re: Can I detect "enter" key using scanf? bd C Programming 0 08-07-2003 02:03 AM
Re: Can I detect "enter" key using scanf? Dan Pop C Programming 0 08-06-2003 11:32 AM



Advertisments