Share
Explore BrainMass

StringLast Function in C++ to find the Last N Characters

The C++ libraries on strings have several functions that can be used to handle various string operations. Write a function called stringlast that can be used to find the last n characters in a string and return a pointer to this new string. Write a main program that calls the function with the pointer to the string and the number of characters from the end (not including the end of string character). Print the output in the main program

Solution Summary

Teaches how to write a C++ program to
a) find the last n characters in a string
b) return a pointer to this new string
c) write a main function that calls the above function with the pointer to the string and the number of characters from the end

$2.19