I figured both of those out last night but thanks for responses. Btw I have a new problem for some reason when I enter 2 at my menu my prog either drops or goes doesnt pass my check for case2. Any ideas on that one?

#include <iostream.h>

#include "apstring.h"

int main()

{

char stop;

int menu;

cout << "Please type in either option 1 or 2.\n";

cout << "Option 1: Decimal to binary conversion.\n";

cout << "Option 2: Binary to decimal converstion.\n";

cin >> menu;

system ("cls");

switch(menu)

{

case 1:

//set up variables

int number, number2, number3, number4, number5, number6, number7, number8;

int check, check2, check3, check4, check5, check6, check7, check8;

//get number

cout << "Please enter number between 0 and 255.\n";

cin >> number;

//check if number is 0-255

if (number < 0 || number > 255)

{

system ("cls");

cout << "Number not valid, please exit and restart.";

cin >> stop;

}

//calculations

check = number / 128;

number2 = number % 128;

check2 = number2 / 64;

number3 = number2 % 64;

check3 = number3 / 32;

number4 = number3 % 32;

check4 = number4 / 16;

number5 = number4 % 16;

check5 = number5 / 8;

number6 = number5 % 8;

check6 = number6 / 4;

number7 = number6 % 4;

check7 = number7 / 2;

number8 = number7 % 2;

check8 = number8;

//Display results

cout << "Your number in binary is,\n" << check << check2 << check3 << check4 << check5 << check6 << check7 << check8;

cin >> stop;

break;

case 2:

//setup variables

int pos1, pos2, pos3, pos4, pos5, pos6, pos7, pos8, total;

apstring binary;

//give pos variables default values

pos1 = 0;

pos2 = 0;

pos3 = 0;

pos4 = 0;

pos5 = 0;

pos6 = 0;

pos7 = 0;

pos8 = 0;

//ask for number

cout << "Please input 8 digit binary number(ex: 10010110) : \n";

getline(cin, binary);

//Check to see if number is only ones and 8 long.

if (binary.length() != 8)

{

system ("cls");

cout << "Invalid number, please restart.";

cin >> stop;

}

if (binary(0) != '0' || binary(0) != '1')

{

system ("cls");

cout << "Invalid number, please restart.";

cin >> stop;

}

if (binary(1) != '0' || binary(1) != '1')

{

system ("cls");

cout << "Invalid number, please restart.";

cin >> stop;

}

if (binary(2) != '0' || binary(2) != '1')

{

system ("cls");

cout << "Invalid number, please restart.";

cin >> stop;

}

if (binary(3) != '0' || binary(3) != '1')

{

system ("cls");

cout << "Invalid number, please restart.";

cin >> stop;

}

if (binary(4) != '0' || binary(4) != '1')

{

system ("cls");

cout << "Invalid number, please restart.";

cin >> stop;

}

if (binary(5) != '0' || binary(5) != '1')

{

system ("cls");

cout << "Invalid number, please restart.";

cin >> stop;

}

if (binary(6) != '0' || binary(6) != '1')

{

system ("cls");

cout << "Invalid number, please restart.";

cin >> stop;

}

if (binary(7) != '0' || binary(7) != '1')

{

system ("cls");

cout << "Invalid number, please restart.";

cin >> stop;

}

if (binary(8) != '0' || binary(8) != '1')

{

system ("cls");

cout << "Invalid number, please restart.";

cin >> stop;

}

//use if statments to find ones

if (binary[0] == '1')

{

pos1 = 128;

}

if (binary[1] == '1')

{

pos2 = 64;

}

if (binary[2] == '1')

{

pos3 = 32;

}

if (binary[3] == '1')

{

pos4 = 16;

}

if (binary[4] == '1')

{

pos5 = 8;

}

if (binary[5] == '1')

{

pos6 = 4;

}

if (binary[6] == '1')

{

pos7 = 2;

}

if (binary[7] == '1')

{

pos8 = 1;

}

//calculate total

total = pos1 + pos2 + pos3 + pos4 + pos5 + pos6 + pos7 + pos8;

//display total

cout << "Binary number equals " << total << ".\n";

//pause and end program

cin >> stop;

break;

}

cin >> stop;

return 0;

}