thanks for helping me...
im using c++ language...
how can you convert decimal to binary..
should i divide it? can you give me a hint for what code should i use...thanks
maHvic
0
Newbie Poster
Recommended Answers
Jump to PostThe same way I showed you in your other thread, only now use an interger as input:
int a = 17; std::cout << std::bitset<CHAR_BIT>( a ) << std::endl;
Will give 00010001 as output (17 binary)
Jump to PostIf you're looking to create a sequence of ones and zeros, you need to do some division and modulus operations.
Look here for some example of the process. You can do a 'net search and find many more examples.
Jump to PostMembers,
Look at thread's start date. It was started on Dec 10th, 2007. Please do not resurrect old threads. By doing so you run the risk of confusing current posters.
Please read the rules before posting again - http://www.daniweb.com/forums/thread78223.html and rules.
Thread Closed.
All 11 Replies
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
vmanes
1,165
Posting Virtuoso
game036
-3
Newbie Poster
jonsca
commented:
Don't bump old threads
-1
WaltP
commented:
Bad code and 3 years late.
-2
manish.ranjan
-5
Newbie Poster
jonsca
commented:
Did you read the post above?
-1
raghuram1987
-1
Newbie Poster
jonsca
commented:
Erm sure...
-1
kvprajapati
1,826
Posting Genius
Team Colleague
sami youssef
-2
Newbie Poster
NathanOliver
commented:
SO you decided to ignore the last post?
-2
asifalizaman
1
Junior Poster
RonalBertogi
46
Junior Poster in Training
$Tweety$
-3
Newbie Poster
AndrisP
193
Posting Pro in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.