How do I "pad" my input to a certain number of bits, say 111 bits more than the original input? Any ideas?
gaasha
2
Light Poster
Recommended Answers
Jump to PostCount how many bits you input.
Use a loop to add more bits from that count to however many you need.
Jump to Postif the number of bits and padding are known at compile time:
(if not, you could use boost::dynamic_bitset http://www.boost.org/libs/dynamic_bitset/dynamic_bitset.html )#include <iostream> #include<bitset> #include <string> template< std::size_t PAD, std::size_t N …
All 5 Replies
Salem
5,138
Posting Sage
vijayan121
1,152
Posting Virtuoso
gaasha
2
Light Poster
Salem
5,138
Posting Sage
vijayan121
1,152
Posting Virtuoso
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.