function prototype

This is a discussion on function prototype within the C Programming forums, part of the General Programming Boards category; there are any company name, its opening hours and days, for example, ABC Corp. - Monday-Friday 10.00-18.00(or 10am-6pm) Saturday 10am-3pm ...

  1. #1
    Registered User
    Join Date
    Jun 2007
    Posts
    3

    function prototype

    there are any company name, its opening hours and days, for example,
    ABC Corp. - Monday-Friday 10.00-18.00(or 10am-6pm)
    Saturday 10am-3pm
    how can i calculate in c the whole working hours of this company, if i`ve got function prototype int hours(char*)?
    the result should be: ABC Corp. - 5(weekdays)*8(hours)+5(hours at weekends) = 45 hours
    thanks for help

  2. #2
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Parse it and return the hours, no one is here to do your homework for you.
    Research, strtok, strstr and alike. Or even just sscanf()

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 05-13-2011, 08:28 AM
  2. Troubleshooting Input Function
    By SiliconHobo in forum C Programming
    Replies: 14
    Last Post: 12-05-2007, 06:18 AM
  3. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 04:45 PM
  4. call to function without prototype
    By lgbeeb in forum C Programming
    Replies: 2
    Last Post: 03-25-2003, 11:20 AM
  5. Replies: 5
    Last Post: 02-08-2003, 06:42 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21