| | |
Exercise using: unsigned int datecode(int year, int month, int day);
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
•
•
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.
•
•
•
•
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.
Thanks for the help :!:
>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.
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.
![]() |
Similar Threads
Other Threads in the C++ Forum
- Previous Thread: need to find occurances in a string
- Next Thread: C++ BASICS ==> Pointers, Call by Reference/Value, Inheritance, Functions & Arrays
| Thread Tools | Search this Thread |
api array arrays based binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game generator getline givemetehcodez graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news node number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






