Purchase Solution

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

Not what you're looking for?

Ask Custom Question

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

Purchase this Solution

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

Purchase this Solution


Free BrainMass Quizzes
C++ Operators

This quiz tests a student's knowledge about C++ operators.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.