Thread: Little help with leap years

  1. #16
    Registered User
    Join Date
    Sep 2006
    Location
    Iowa
    Posts
    14
    I'm using Microsoft Visual Studio 2003 to write this stuff. It's the program we got to download for free for our class.

  2. #17
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Quote Originally Posted by Salem
    In C, all declarations must come before statements.
    It's allowed in C99, right? I declared variables after statements in my C99 class and the instructor passed my program. I haven't read the standard though.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  3. #18
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,666
    Yes it is in C99.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Leap Year Problems
    By jc99 in forum C Programming
    Replies: 13
    Last Post: 06-21-2009, 04:02 AM
  2. why does this program say 1700 is a leap year?
    By newbcore in forum C Programming
    Replies: 7
    Last Post: 12-19-2008, 02:03 AM
  3. Help with leap year program.
    By IxTanGxI in forum C Programming
    Replies: 8
    Last Post: 02-20-2006, 08:49 PM
  4. Working out leap years.
    By parnaby in forum C++ Programming
    Replies: 4
    Last Post: 01-20-2006, 08:41 AM
  5. Leap year program prints wrong output
    By Guti14 in forum C Programming
    Replies: 8
    Last Post: 08-24-2004, 11:56 AM