I'm trying to make a program that will convert decimal to binary. I think I have the steps right but I need to put each character into a string or char array to output them in the right order. I thought I could do temp.ToString(), but that doesn't work. Also, how would I be able to check the input to make sure it is in fact an integer.
#include <iostream>
#include <string>
using namespace std;
int main()
{
int decimal = 0;
string output = "";
int temp;