Q&A Discussions
std::string
1 Vote
3 Answerschar* vs std::string
0 Votes
1 Answer#include <iostream>
#include <bitset>
int main()
{
int myDecimalNumber;
std::cin >> myDecimalNumber;
std::string binary = std::bitset<8>(myDecimalNumber).to_string(); //to binary
std::cout<<binary<<"\n";
unsigned long decimal = std::bitset<8>(binary).to_long();
std::cout<<decimal<<"\n";
return 0;
}
2 Votes
5 AnswersHot today
Fix code
0 Votes
Fast coding (mobile)
1 Votes
..
1 Votes
Software to write and run codes
1 Votes
Beginner_to_SoloLearn
2 Votes
Add lua
0 Votes
Coding help
1 Votes
Summary please??
0 Votes