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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:13:24+00:00 2026-06-14T14:13:24+00:00

guys, I have a problem, please help me! I have a CString variable which

  • 0

guys, I have a problem, please help me!
I have a CString variable which will receieve from Database,and the data may like this:(8)(9)(10)(11) or more.

Now I want to change every number in CString,for example, add 1,the outcome should like this:

CString Data; the contest of CString data variable should be changed.

Before: (8)(9)(10)(11)

After: (9)(10)(11)(12)

I’ve tried Data.GetAt(i),but it returns a const pointer and I can’t change it.

I konw maybe Data.GetBuffer() can get a pointer to manipulate CString,but I don’t know how to do it.

So please help me ! Thanks a lot!

  • 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-14T14:13:24+00:00Added an answer on June 14, 2026 at 2:13 pm

    Don’t change in-place. Specifically in your example, when you change (9) to (10) it needs 1 extra character of buffer space. Extract all the values somehow (a std::list of int perhaps), add whatever numbers you need, and then re-assemble into a string, and write it back all at once.

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

Sidebar

Related Questions

Guys, please help me with the following problem. I have encountered the famous cannot
please help me out with this problem.I have a contact form like this: <div
I hope some of you guys can help me with this problem.... I have
I have this function of mine which selects all room types from the database,
I wanted so much help from you guys :( ok, my problem is how
Hi guys i have a problem i my code i set a datepicker with
guys. I have a strange problem. I try to write unit-tests to web-app. I
Ok guys, I have a serious problem with this. I have a static class
Hey guys, I have a weird problem. I have an update system that refreshes
hey guys having this really simple problem but cant seem to figure out have

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.