Hey guys, I am attempting to take in 2 strings and store them in reverse order in 2 integer arrays. So for example, I enter 12345 into string1 and 54321 would be stored into array1. However, my program hangs after I input my strings. I can't tell what's wrong with my algorithm, is anyone else able to tell me how and where I screwed up?
int reverseStrings(string str1, string str2, int** array1, int** array2)
{
int length1, length2;
length1 = str1.length();
length2 = str2.length();
array1 = new (nothrow)int*[length1];
array2 = new (nothrow)int*[length2];
A suggestion is to make sure there is a 0x0 (NULL terminator) in the input strings. If not your program could be processing the ram address beyond it's boundry because it can't find the 0x0 code.