Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 642565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:11:09+00:00 2026-05-13T21:11:09+00:00

I was reading the following text from Stanford’s Programming Paradigms class , and I

  • 0

I was reading the following text from Stanford’s Programming Paradigms class, and I noticed that when the author uses the string class, the constructor does a function call that looks like this:

string::string(const char* str) {
    initializeFrom(str, str + strlen(str));
}

If the initializeFrom function takes two char* arguments, how come the second argument can pass a (char* + int) to a char* and have it work out properly? How does the type system interpret this statement?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:11:10+00:00Added an answer on May 13, 2026 at 9:11 pm

    That is called pointer arithmetic. A char* + int results in a char* that is int characters higher in memory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am reading some C++ text and got the following code: From that code,
I am reading a tutorial that uses the following example (that I'll generalize somewhat):
Consider the 2 following methods of reading a string from a file: NSString *path
while reading from BRUCE ECKEL'S THINKING IN C++..i came across the following text In
I am reading a algorithms book by S.DasGupta. Following is text snippet from the
I am reading modern C++ design. Following is the text snippet taken from typeinfo
I have the following text tooooooooooooon According to this book I'm reading, when the
In a way following on from reading a windows *.dmp file Having received a
I am reading in data from a file that has three columns. For example
I was reading JavaScript: The Good Parts and the author mentions that JavaScript is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.