Hello, I'm attempting to write a function that converts a string into an array of characters. This is for an encoding project I have to work on. However, my code doesn't seem to work. Any help would be appreciated.
for (int j = 0; j < 502; j++) I don't see why you have this loop. It looks like you are just doing the same thing 502 times.
The return statement in _stringtochar_ will end the function so the loop in that function doesn't have any effect. My guess is that you don't want the return inside the loop. The return value is never used, so what exactly is it you want the function to return?
Why do you want to convert the string to a char array anyway? Can't you just change the chars in the string through operator[]?