I am taking a class in C and I am having a problem bringing an int through scanf. I have to create a function that will check a date in this format (MMDDYY). So I have set up a scanf for the users input and then I bring it into the function.
It works fine unless the date starts with a 0. For example if the date I input is 022804 then when I printf thedate in the function it just outputs 18. I realize what is happening here is that it is reading the date as an octal notation because it starts with a 0, but how do I get it to stop doing that and read it as an integer?