string myString="";
int c;
int arrayMain1[100]={0}, arrayMain2[100]={0},arrayMain3[100]={0};
cout << "Input Number" << endl;
cin >> myString;
cout << myString[0]<<endl;
if(myString.length()<=100)
{
c=99;
for(int i=myString.length();i>=0;i--)
{
//cout << myString[i];
arrayMain1[c]=myString[i];
c--;
}
for(int j=0;j<=100;j++)
{
cout << arrayMain1[j];
//cout << myString[j];
}
}
Here is my code, its suppose to copy the string I input to the end of an array. If my input string is '1234' the array would look, 0000....1234. For some reason when I print the array, it prints wrong numbers.