At an interview one time, I was told to write a function that will take in a string and reverse the order and return it.
One way I *tried* to do it is
1. find out the size of the string
2. create new array the same size,
3. Make the size of the string a counter counting down and enter every newstring[counter] = string[endcounter];
Maybe there was a more creative way to do this since they asked me to do it. Maybe somehow use recursion? ANyone know?
One way I *tried* to do it is
1. find out the size of the string
2. create new array the same size,
3. Make the size of the string a counter counting down and enter every newstring[counter] = string[endcounter];
Maybe there was a more creative way to do this since they asked me to do it. Maybe somehow use recursion? ANyone know?
