C/C++ newb program(need help)
I am new to programming all together and was referred to this site so as I could ask a question about a program I am trying to make(keep in mind this is a very simple program to you guys probably).
(done in C/C++)
#include <iostream.h>
#include <stdio.h>
#include <string.h>
#include <windows.h>
#include <stdlib.h>
int main()
{
bool exitProg = false;
while(exitProg == false)
{
char mainChoice;
char inputChar[1000], outputChar[1000];
int inputInt[1000], outputInt[1000];
for(int b = 0; b <= 999; b++)
{
inputInt[b] = 0;
outputInt[b] = 0;
}
int mod = 0;
int e = 0;
int d = 0;
printf("Welcome to Dencoder, please type the letter of your selection:\n");
printf("a. Encode Message \nb. Decode Message\nc. Exit Program\n");
cin >> mainChoice;
switch(mainChoice)
{
case 'a':
printf("\n\nPlease enter your message you want encoded:\n");
scanf("%s", &inputChar);
printf("\nPlease enter your modifier(a number, 1-100 to help better encode your message):\n");
cin >> mod;
//scanf("%d", &mod);
printf("\nYour encoded message is:\n");
do
{
outputInt[e] = atoi("inputChar[e]") + mod;
if(inputInt[e] = '\0')
{
outputInt[e] = '\0';
}
printf("%d ", &outputInt[e]);
e++;
}while(inputChar[e] != '\0');
printf("\n\n\n\n");
break;
case 'b':
break;
case 'c':
exitProg = true;
break;
}
}
return 0;
}
ok I need you to ignore the case b and case c for now I am just trying to get it to encode, but whenever I try that, it outputs huge numbers for my outputInt. it always outputs numbers like 12 thousand or so. and if you don't know what the atoi() command is, it takes a char's ascii number and puts it into an integer format. please respond to this, it is bugging the hell out of me and I can't figure out why it is outputting numbers like 1280049 or other high numbers like that.