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 6152447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:55:19+00:00 2026-05-23T19:55:19+00:00

I am having a mental block and I know I should know this but

  • 0

I am having a mental block and I know I should know this but I need a little help.

If I declare a string variable like this:

    string word = "Hello";

How do I find the memory address of “Hello”?

Edit: This is what I am trying to do…

Write a function that takes one argument, the address of a string, and prints that string once. (Note: you will need to use a pointer to complete this part.)

However, if a second argument, type int, is provided and is nonzero, the function should print the string a number of times equal to the number of times that function has been called at that point. (Note that the number of times the string is printed is not equal to the value of the second argument; it is equal to the number of times the function has been called so far.)

  • 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-23T19:55:20+00:00Added an answer on May 23, 2026 at 7:55 pm

    Use either:

    • std::string::data() if your data isn’t null-terminated c-string like.

    or

    • std::string::c_str() if you want the data and be guaranteed to get the null-termination.

    Note that the pointer returned by either of these calls doesn’t have to be the underlying data the std::string object is manipulating.

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

Sidebar

Related Questions

I know this should be painfully simple, but I'm having a mental block. I
Having a mental block.... I know this is so easy.... but nothing is going
I know I've come across this problem before, but I'm having a bit of
Having a mental block today, need a hand verifying my logic isn't fubar'ed. Traditionally
Having a mental block with going around this query. I have the following tables:
Can’t be hard, but I’m having a mental block.
Im having a bit of a mental block on this one. I got booking
Okay, I'm having a bit of a mental block today/this week, so I'm probably
I'm having a mental block for the words describing data flow in a communications
Having a mental block due to caffeine depravation... If I add two drop-downs to

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.