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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:59:12+00:00 2026-06-14T05:59:12+00:00

I want to remove the first character of a string using memmove Example, a

  • 0

I want to remove the first character of a string using memmove

Example, a std::string might contain:

./Folder/File.txt

I want to remove the .

I am doing:

if (newStr[0] == '.')
{
    memmove(newStr, newStr+1, strlen(newStr));
}

and getting an error: error: no match for 'operator+' in 'newStr + 1'

What mistake am I making?

UPDATE: oh, I think I should be using char* this wont work on a std::string

  • 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-06-14T05:59:13+00:00Added an answer on June 14, 2026 at 5:59 am

    It appears like your newStr is a std::string, in this case you should use newStr.erase(0,1);

    See this site for more information about erase

    memmove is only valid if you are dealing with a buffer directly (char* or char[]). If your type is std::string, use the function that’s meant for it (erase) and don’t try memmove on the c_str.

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

Sidebar

Related Questions

I want to remove a backslash character from this string: String result = [{\venues\:{\venueId\:1,\name\:\First
I would like to remove the first character of a string. For example, my
I want to remove the first character of a string like so, $a1 =
I want to remove the string code=hads1328fas& on my URL, so that BEFORE http://example.com/main/index.php?code=hads1328fas&store=food#home
I want to remove duplicate lines from a file, without sorting the file. Example
I want to remove the first characters from a string. Is there a function
I want to remove first character from link's text with jQuery. <span class=test1> +123.23
I have a string of this format /abcd-efg-sms-3-topper-2 I want to remove the first
I wish to remove text from a string from the first non-allowable character on.
i want to remove the link from my header using CSS so that only

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.