Write a function to reverse the words in a string? (e.g. “Your time has come” – > “come has time Your”)

This could be achieved by first writing a function to reverse the whole string. The output from this function will be.. “emoc sah emit ruoY”. Now we need to call same function for each individual word. So the final output will be “come has time Your”

What is a double pointer? Why is it required? Is it necessary in C++?

Pointer to a pointer is called double pointer. It is needed when one wants to manipulate the pointer itself like in linked list manipulation etc. In C++ same thing can be accomplished using reference which also avoids the overhead of copying.

Technology