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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:21:27+00:00 2026-06-01T10:21:27+00:00

One should always use std::string over c-style strings( char * ) is advice that

  • 0

“One should always use std::string over c-style strings(char *)” is advice that comes up for almost every source code posted here. While the advice is no doubt good, the actual questions being addressed do not permit to elaborate on the why? aspect of the advice in detail. This question is to serve as a placeholder for the same.

A good answer should cover the following aspects(in detail):

  1. Why should one use std::string over c-style strings in C++?
  2. What are the disadvantages (if any) of the practice mentioned in #1?
  3. What are the scenarios where the opposite of the advice mentioned in #1 is a good practice?
  • 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-01T10:21:28+00:00Added an answer on June 1, 2026 at 10:21 am
    1. std::string manages its own memory, so you can copy, create, destroy them easily.
    2. You can’t use your own buffer as a std::string.
    3. You need to pass a c string / buffer to something that expects to take ownership of the buffer – such as a 3rd party C library.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've heard people advise that one should always use the Iterator pattern to control
After reading some tutorials I came to the conclusion that one should always use
It seems to me that one should always properly dispose resources when calling Directory
I read somewhere that one should never use error conditions as normal program flow.
It is to my understanding that one should use a forward-class declaration in the
I recall that one should always avoid using recursive method calls in Java .
When should one compare String s as objects and when should one use their
We are using NUnit to run our integration tests. One of tests should always
Which one should I use? catch (_com_error e) or catch (_com_error& e)
I am writing my own blog (every one should, it's good experience). I 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.