Exercise using: unsigned int datecode(int year, int month, int day);

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2004
Posts: 421
Reputation: JoBe is on a distinguished road 
Solved Threads: 4
JoBe's Avatar
JoBe JoBe is offline Offline
Posting Pro in Training

Re: Exercise using: unsigned int datecode(int year, int month, int day);

 
0
  #11
Mar 29th, 2005
Originally Posted by Asif_NSU
the bit_print() function just prints an integer in binary. But the integer to be printed should come from the datecode() function, which Narue showed in his first post. This two functions together solves your problem that you stated in your very first post.
Aha, now I understand :!:

you should include climits because it has the value for CHAR_BIT. If it works without it probably u included something that does the same job, maybe iostream, i m not sure.
It must be iostream that does it since I didn't include any other headerfile.

Thanks for the help :!:
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,740
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 739
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: Exercise using: unsigned int datecode(int year, int month, int day);

 
0
  #12
Mar 29th, 2005
>Because C is still out there along side C++
And if you're using C++ then you should take advantage of it. If the C solution is used because "C is still out there along side C++" then why use C++ in the first place? I'm sorry, but I find that excuse lacking.

>Is bitset a headerfile wich exists
bitset is a standard template class defined in the <bitset> header. It's handy every now and then, but for the most part it's not a commonly used class from the standard library.

>It must be iostream that does it since I didn't include any other headerfile.
Don't rely on that behavior though. When you use a something from the standard library, you should include the correct header for your code to be valid on every compiler.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 353
Reputation: Asif_NSU is on a distinguished road 
Solved Threads: 2
Asif_NSU's Avatar
Asif_NSU Asif_NSU is offline Offline
Posting Whiz

Re: Exercise using: unsigned int datecode(int year, int month, int day);

 
0
  #13
Mar 29th, 2005
I'm sorry, but I find that excuse lacking.
Here's another: It will help one understand how to do it manually, increasing one's knowledge.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,740
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 739
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: Exercise using: unsigned int datecode(int year, int month, int day);

 
0
  #14
Mar 29th, 2005
>Here's another: It will help one understand how to do it manually, increasing one's knowledge.
That's more like what I was expecting.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC