Thread: need help with strings

  1. #16
    Registered User
    Join Date
    Mar 2005
    Posts
    60
    Oh no...not only does it return 1.000000 for the %f in my printf, but if I input 357, it returns the statement for water and not mecury. What am I doing wrong?

  2. #17
    Registered Luser cwr's Avatar
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    869
    For a start, scanf (but not printf) requires %lf for a double argument.

    Secondly, your within_x_percent function is declared to return an int, but you have no return statement. Why?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Strings Program
    By limergal in forum C++ Programming
    Replies: 4
    Last Post: 12-02-2006, 03:24 PM
  2. Programming using strings
    By jlu0418 in forum C++ Programming
    Replies: 5
    Last Post: 11-26-2006, 08:07 PM
  3. Reading strings input by the user...
    By Cmuppet in forum C Programming
    Replies: 13
    Last Post: 07-21-2004, 06:37 AM
  4. damn strings
    By jmzl666 in forum C Programming
    Replies: 10
    Last Post: 06-24-2002, 02:09 AM
  5. menus and strings
    By garycastillo in forum C Programming
    Replies: 3
    Last Post: 04-29-2002, 11:23 AM