Hello, i was given a project to do on c++, i was supposed to write a cpp code that would reverse a *char element(word) leaving the last letter as it is, say, "12345" would be "43215".
Can you please explain what the use of the void print(char*str) function and its contains. I need to explain this code to my teacher but i stuttered on this part. Thanks inadvance.
All i ask for is to explain in detail what every line is responsible for, i have written half of this code and gotten help from somebody else but from his explanation he told me that it enables to print in the first line. I have ran this program and it works perfectly fine. User inputs a word, it returns the inputted word and then the reversed word but the last letter stays the same, 'hello12345' to '4321olleh5'.
Alright, let me get this straight, i haven been given this project to do, i wrote what i could and went to the academy i learn in and asked for an extra lesson, a new teacher was appointed for me and with his help we finished the project, he helped me by putting the for loop into the void print function which i didn't know anything about (our teacher didn't teach us anything about it). I have understood every single line in this cpp code except the line where the function voidprint(char*str) is declared.
no need to come at me as if i cheat or anything, i deliberately didn't include background on the project to get the solution as short and quick as possible.