So I'm in an intro C++ programming course and I'm completely stuck right now. I am supposed to make a Decimal to Binary converter using functions, store the 1's and 0's in an array. Then use a Raspberry Pi 2 to light up LEDs on a breadboard. I have no idea how to store the 1's and 0's in an array using a function. Here's my code. Any help will be appreciated.
cout << " Decimal to Binary Converter \n";
cout << "++++++++++++++++++++++++++++++++++++++++++++++ \n";
cout << "+ This program converts Decimal numbers into + \n";
cout << "+ 8-bit Binary numbers. + \n";
cout << "++++++++++++++++++++++++++++++++++++++++++++++ \n\n";
cout << "Enter 1 to run the program. \n";
cout << "Enter 2 to exit the program. \n";
cin >> options;
if ((options > 2)|| (options <= 0))
{
cout << "\nERROR! Not a valid option. \n";
cout << "Press the enter key to continue...";
cin.clear();
cin.ignore();
cin.get();
goto Top;
}
switch (options)
{
case 1:
Reset:
cout << "Please enter a positive decimal number (or) \n";
cout << "Enter a negative number to go back to the menu: ";
cout << "\nThe Binary conversion for the Decimal number " << DecNum << " is: ";
DecBin(DecNum);
cout << "\n\nPress the Enter key to continue...";
cin.get();
cin.get();
system("clear");
goto Reset;
break;
case 2:
cout << "\nYou have chosen to exit the Decimal to Binary Converter. Good-bye! \n";
exit(0);
cin.get();
break;
default:
cout << "\nERROR! Please enter a NUMBER only! \n";
cout << "Press the enter key to continue... \n";
cin.fail();
cin.ignore();
cin.clear();
cin.get();