Menu
Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Convert __DATE__ to unsigned int
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Martin Ambuhl" data-source="post: 1692198"><p>__DATE__ has the for "Mmm dd yyyy", so "12 Dec 2003" is not a possible </p><p>value. Get the number for the month by using strstr on an array containing </p><p>the month names as used by asctime (char monthname[] = "JanFebMarApr...)</p><p></p><p>This is a trivial exercise, and I'm sorry to say that your post does not </p><p>make it clear what your problem is, apart from your not having the form for </p><p>__DATE__ right and asking the preprocessor to do something for which it is </p><p>not designed.</p><p></p><p></p><p>Good luck. Looking up the number corresponding to the month seems a bit </p><p>difficult at compile time.</p></blockquote><p></p>
[QUOTE="Martin Ambuhl, post: 1692198"] __DATE__ has the for "Mmm dd yyyy", so "12 Dec 2003" is not a possible value. Get the number for the month by using strstr on an array containing the month names as used by asctime (char monthname[] = "JanFebMarApr...) This is a trivial exercise, and I'm sorry to say that your post does not make it clear what your problem is, apart from your not having the form for __DATE__ right and asking the preprocessor to do something for which it is not designed. Good luck. Looking up the number corresponding to the month seems a bit difficult at compile time. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Convert __DATE__ to unsigned int
Top