Q&A Discussões
Print() or return()?
1 Voto
2 Respostas#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 Votos
5 RespostasC#Love Chat-6
4 Votos
6 Respostascan someone please explain why this code keeps telling me complication error instead of outputting the value of speed.
#include <iostream>
using namespace std;
class myClass {
public:
void setcarspeed (int a){
speed=a;
}
int getcarspeed(){
return speed;
}
private:
int speed;
};
int main() {
myClass obj;
obj.setcarspeed (40);
cout<<obj.getcarspeed ;
return 0;
}
2 Votos
3 Respostas3 guesses
0 Voto
1 RespostaQuente hoje
How to improve code readability
0 Votes
App
1 Votes
I NEED to make a game
0 Votes
Regarding course
0 Votes
Solved Grouping data
0 Votes
Android
0 Votes