menu-iconExamlexExamLexServices

Discover

Ask a Question
  1. All Topics
  2. Topic
    Computing
  3. Study Set
    C++ Study Set 1
  4. Exam
    Exam 12: More on C-Strings and the String Class
  5. Question
    To Access the Last Character of a String Class Object
Solved

To Access the Last Character of a String Class Object

Question 2

Question 2

Multiple Choice

To access the last character of a string class object str you can use the expression


A) str.last() .
B) str[last].
C) str[str.length() ].
D) str[str.length() -1].
E) None of the above

Correct Answer:

verifed

Verified

Related Questions

Q3: To declare a C- string, you should

Q4: The function accepts a C- string as

Q5: To declare an array that will store

Q6: A good way to convert a string

Q7: The function concatenates the contents of one

Q8: The string class member function returns the

Q9: The library function reverses the order of

Q10: The proper expression to compare the first

Q11: A C- string can be assigned to

Q33: Although C++ provides ample library functions to

Examlex

ExamLex

About UsContact UsPerks CenterHomeschoolingTest Prep

Work With Us

Campus RepresentativeInfluencers

Links

FaqPricingChrome Extension

Download The App

Get App StoreGet Google Play

Policies

Privacy PolicyTerms of ServiceHonor CodeCommunity Guidelines

Scan To Download

qr-code

Copyright © (2025) ExamLex LLC.

Privacy PolicyTerms Of ServiceHonor CodeCommunity Guidelines